Link to home
Start Free TrialLog in
Avatar of psimation
psimationFlag for South Africa

asked on

Strip characters from right of string

Hi
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"];
      if($pict) {
      $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...

Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial