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
Remove Certain Last Characters From A String In Php
Post Description: remove certain last characters from a string in php
POST# 416
Posted On: Fri Feb 29, 2008 12:01 pm
web hosting
Topic: 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);
?>




No Repies
(0) Comments for Remove Certain Last Characters From A String In Php

What do you think?

* name:  

* email:  

* Please enter comments:


Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

Add image to comments
yes no             upload