- Forums
- PHP
- Remove Certain Last Characters From A String In Php
This Page Contains information about Remove Certain Last Characters From A String In Php By wallpaperama in category PHP with 0 Replies. [1045], Last Updated: Sat May 18, 2024
wallpaperama
Wed Jun 20, 2007
0 Comments
714 Visits
in this example, lets say i have this string:
$string = "i like all the wallpapers at wallparama. they are very nice";
well, i only want to display: i like all the wallpapers at wallparama and remove the rest
this is how i would do it.
<?php
$string = "i like all the wallpapers at wallparama. they are very nice";
$newstring = substr($string, 0, strpos($string, "."));
echo($newstring);
?>