...

View Full Version : Left() in PHP?



StupidRalph
09-04-2005, 06:55 AM
Is there any function like the left() in ASP? I am trying to display only the first twenty characters of a string in PHP. Any idea?

dumpfi
09-04-2005, 11:02 AM
Use substr($text, 0, 20);

dumpfi

Noodles24
09-04-2005, 04:07 PM
You could write your own left function



function left($string, $count){
return substr($string, 0, $count);
}

StupidRalph
09-09-2005, 04:03 PM
That works perfectly thank you very much.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum