Menu
I’m looking for some help with converting special characters within a string to a different character.
Current Code:
[code]<?php echo $use[‘value’] ?>
$use is an array
[‘value’] is the string within the array
I’m taking the data from $use[‘value’] and using it in a URL. The problem is if $use[‘value’] is something like “Home Projects & Hobbies” the URL gets messed up; it will look like /Home%20Projects%20&%20Hobbies.
So, if possible, I want to write a little script that will take the spaces of the string and convert them into “-” and take the “&” symbol and convert it into “and”.