Hi Jackie
One way of doing it would be using a regular expression, and worth reading up on the preg_match function in PHP.
I have just been learning the functions myself and the code below should give you the charactors from the beginning of the string up to the "_" charactor
$pattern = '/^(.*)_/';
$string = 'jackie_patel';
preg_match($pattern,$string,$matches)
echo $matches[1]
This is a very basic expression and you may want to make your search more specific ie search for whites spaces, etc