Jump to content

Grabbing all the text in a text to the left of a token?


dmccabe

Recommended Posts

Ok I have this text:

 

User Name (Real Name)

 

I want to grab the text "User Name" and "Real Name" separately?

 

How can I split them, I know it has something to do with Strpos and Substr, but I just cant get it right or anywhere close, this is where I get before getting all kinds of  confused:

 

$pos = strpos($author, "(");
$name= substr($author, $pos, -1);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.