Remove Certain Last Characters From A String In Php



Remove Certain Last Characters From A String In Php
Remove Certain Last Characters From A String In Php
Post Description:
Post Tags: remove, certain, last, characters, from, a, string, in, php
This Post Has Been Viewed 298 Times Since Wed Jun 20, 2007 9:02 am Posted By hostman with 0 replies
Remove Certain Last Characters From A String In Php
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);
?>



Leave Your Comments     [ dejar commentarios ]
  * Name     [nombre]

  * eMail (will not be published)     [coreo electronico]

* Enter Your Reply or Comments:    [commentarios]


Add Picture To Comments         [incluir foto]
YES NO             upload
Receive Replies on my Comments (An email will be sent to you when someone replies to your comments)

     

Comments and replies About Remove Certain Last Characters From A String In Php




(0) Comments