我读到你可以在逗号(,)之前找到标题Get the title before comma
但是想知道我怎么才能得到这个头衔after 逗号(,)?
是否也可以使用strtok()?还是有类似的功能?
谢谢
您可以这样使用
<?php
$sTitle = "Your, Title";// From get_the_title(); or other sources
if(strpos($sTitle , ",")){
$sTitle = substr($sTitle , strpos($sTitle , ",") + 1);
}
echo $sTitle; // You can also trim($sTitle); to remove whitespaces left from substr()
?>
我想更改我网站的登录URLhttp://example.com/wp-admin 到http://example.com/example.我不想使用插件来实现这一点,所以我可以从函数中实现这一点。php?