php get string before character
snippet in php

get the string after a character in php

user5483

$data = "123_String";    
$whatIWant = substr($data, strpos($data, "_") + 1);    
echo $whatIWant;

php get string before character

user9124

$arr = explode("/", $string, 2);
$first = $arr[0];