0
我正在尝试根据标题进行搜索。网址php中的网址标题
像这样:
$alfred = get_the_title();
$link11 = "http://example.com/?s=$alfred";
的问题是:
当标题是
Account Manager (m/w) Software-/IT-Lösungen (non Microsoft)
它使这个网址:
jobsde.de/?s=AccountManager%28m/w%29Software-/IT-L%C3%B6sungen%28nonMicrosoft%29
或当标题是
Recruiting Consultant (m/w)
成为jobsde.de/?s=RecruitingConsultant%28m/w%29
WordPress的搜索不会给我我想要的结果。 我认为必须有一种方法来妥善处理这一点,但我不知道如何。有什么想法吗?
我发现this
我现在有:
$title = get_the_title();
sanitize_title_for_query($title);
$link5 = "http://jobsde.de/?s=$title";
,这并不工作。 的网址仍然是这样的:
jobsde.de/?s=HandelsvertreterPhotovoltaikSolarW%C3%A4rmepumpePhotovoltaikBeratersolarberater
我应该使用什么码?