I've read that you can get the title before comma(,) Get the title before comma

but wondering how can I get the title after comma(,) ?

is it also possible to use strtok()? or are there similar function?



You can use in this way

$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()
  • glad i could help
    – Ignat B.
    Aug 31 '15 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.