我正在创建网址形式我张贴的标题。这里是一些样本标题。
标题示例:
$title = "Global Campaign Manager - (SEO and Advertising)";
$title = "Broadcast Journalist, BBC News Online (London)";
$title = "Agile Digital Project Manager/£475 - 525 pd/6 months/London";
现在,这里是URL的例子,我期待的形式这个标题.
预期URL:
www.example.com/global_campaign_manager_-_seo_and_advertising
www.example.com/agile_digital_project_manager475_-_525_pd6_monthslondon
www.example.com/broadcast_journalist_bbc_news_online_london
1条答案
按热度按时间ee7vknir1#
要将任何标题或文本转换为url代码,igniter具有URL Helper
此帮助器是使用以下代码加载的:
现在,要将字符串转换为正确的URL。用户url_title
结果URL
www.example.com/agile_digital_project_manager475_-_525_pd6_monthslondon