How to select all characters to the right of a specific character in a string - PHP
I spent a long time trying to figure this out! How do I select all the characters to the right of a specific character in a string when I don't know how many characters there will be?
You can also do:
$str = 'some_long_string'; echo explode( '_', $str, 2); // long_string
// find the position of the first occurrence of the char you're looking for $pos = strpos($string, $char); // cut the string from that point $result = substr($string, $pos + 1);
I'm not sure this would fit your needs, but :
$string = explode(',','I dont know how to, get this part of the text');
Wouldn't $string always be the right side of the delimiter? Unless you have more than one of the same in the string... sorry if it's not what you're looking for.