Jump to content

Spaces in hyperlinks using php


matty84

Recommended Posts

Hi,

I am tryingo to create a link to an image in a database using php. the following code works when the images do not have spaces:

echo "<td><a href=dbimages/$photo target=new>$photo</a></td>";

but some images are labelled 1223 - 2323.jpg for example (with spaces). When viewing the page the link for these images coes out like :http://.../1223

is there a way to tell php to include the spaces but make them %20 or something??

Matt
Link to comment
https://forums.phpfreaks.com/topic/27441-spaces-in-hyperlinks-using-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.