image uploading and fetching problem
my image name is like this:-- demo 123.jpg
can i save that image name demo 123 in database column. And in also in folder as demo 123.jpg
when i am fetching with demo 123.jpg it can not find image name because..
peoblem开发者_开发问答 is space in name of image...
i dont want to replace space in image name with any character like _
can i do it without it.?
try this:
`demo 123.jpg`
What you need to do is make sure that when the image is saved, all the spaces are converted to - or _ using a regular expression like this
preg_replace('/\s/i', '-', 'demo 123.text');
This will make sure all spaces are converted to hyphens. Now save this name into your database and also use that name to rename the file when its uploaded.
精彩评论