PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Having a bit of trouble. $boxart - holds a url with the name of a game, contains punctuation such as : and ! which i need to remove. I have tried below with no luck.
Your first variable should probably be called '$newbox'. Below is an example (based on your code) that uses arrays. If you have multiple values to be replaced you should use arrays with str_replace().
Understood. It did what it was supposed to. BUT not what im trying to achieve. What it is, i have around 5000 images that are named like the following $id-$name-$category.jpg
Now im trying to insert the url of these images into the according row on the mysql database. The $id $name and $category is the same on both the db and the image name. So what i thought was to make up the url in the php script then somehow insert it into the database. But some images contain characters such as : colons and ! exclamation marks, so when i try to display the image it does not show.
hhhmmm, STRTOLOWER converts everything to lower case. What if i dont want this to happen? How can i stop this form happening when i remove the characters?
blade_922 wrote:Call to undefined function srt_replace() in /home/public_html/videogamingcave/aaa/img/gameslist.php on line 33
That srt_replace should be str_replace.
blade_922 wrote:hhhmmm, STRTOLOWER converts everything to lower case. What if i dont want this to happen? How can i stop this form happening when i remove the characters?
You could remove the strtolower() function?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering