Extract a string or text or a value before a special character.
This code can be used if you are trying to extract an id or a text in a link or any given string.
In this sample code we will separate the text - number which are located before the underscore ( _ )
$text = "this_is_a_sample_text";
$data = strstr($text, '_', true);
//result will be "this"