Strip characters from right of string
Posted on 2004-09-16
I have entries in a mysql table that I read out, and then display on a page. The entries are the names of images, but some contain spaces in the name, eg. Image 234.jpg
What happens now is that I do this:
$pict = $myrow["picture"];
$picture = trim($pict);
$picture = rawurlencode($picture);
// $picture = rtrim($picture, "%5C%22");
For some reason, when I look at the source of the resulting page, there are "%5C%22" added to the end of the image name in the SRC line, causing the image not to be displayed.
As you can see, I tried an rtrim specifying these characters, but it does not remove them...