remove certain last characters from a string in php

RegisterLogin
remove certain last characters from a string in php
Post Description: remove certain last characters from a string in php
Tags: remove, certain, last, characters, from, a, string, in, php
This Post Was Posted On Feb 29, 2008 By web hosting #1257
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
Related Pages: [Add Your Website]
Post New Topic
©2012 Webune Forums - Wed Dec 19, 2012 10:43 am
Powered by: Webune Forums V3