supposed i hava a string and the the value ot the string is: i love wallpaperama.com even more
so this is how the PHP would look like so far:
$string = 'i love wallpaperama.com even more';


now, lets say i don't want the ten characters ( even more) to show i only want i love wallpaperama.com. so if want to erase the part that says ' even more' this is how my code would look like so far:
$string = 'i love wallpaperama.com even more';
$string = substr($string, 0,23);

What the substr() function tells php is that to on get the first first 23 charracters starting a 0, therefore, removing the last 10 characters, so if i were to echo $string, the value would come out like this i love wallpaperama.com

here's the complete script:
<?
$string = 'i love wallpaperama.com even more';
$string = substr($string, 0,23);
echo string;
?>


OUTPUT:
i love wallpaperama.com



COURTESY: thanks to the webune.com team for their help on this. Find PHP hosting and more scripts at www.webune.com

NEXT: how to display the last characters of a string in PHP