I'm trying to convert text into pictures for using it as gender signs on my website.
This is my code:
it does convert "male" to the gender icon, but the female icon turns out like this:
$gendertext = array("female", "male");
$genderimg = array("<img src=\"img/sex-female.gif\" border=\"0\">", "<img src=\"img/sex-male.gif\" border=\"0\">");
$gender = str_replace($gendertext, $genderimg, $userrow['gender']);
It's obviously that it converts every word with the word "male" in it first which make the "female" word converted too. Anyone have a solution for this? I am too familiar with regex so I wouldn't use that :P