Hello all, You have been lots of help in the past, so I was wondering if you could help me out with this, basically I just have to parse a string similar to "4,31m)" figure out if it is numeric or not, then if it is remove the last to characters on the string (the 'm)') and change the string so that it is 4.31. There is probably a better way of doing this but I can't figure out how to make it better or more efficient
$tim = "3,43m)"; // take into account that the last 2 characters may not be\ 'm)' like we are expecting, and store them in a var $last2ontime = substr($tim,strlen($tim),strlen($tim)-3); $tim = str_replace(",","",$tim); // get rid of the , in the time (i.e. time = 3,43 and we want it to be 343) $tim = substr($tim,0,strlen($tim)-2); if(is_numeric($tim)){ if($debug){ print nl2br( "Time is Numeric!\n" ); } $t = substr($tim,0,strlen($tim)-2); $te = substr($tim,strlen($tim)-2); if($debug){ print nl2br( "T = $t\nte = $te\n" ); } if(is_null($t) or $t == ""){ $tim = $te[0] .".0". $te[1]; }else{ $tim = (string)$t .".". (string)$te ."m)"; } }else{ if($debug){ print "got else!"; } Thank You, Mike [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php