monkeybidz Posted April 30, 2009 Share Posted April 30, 2009 I have this code that gives me the result I want, but when the result includes a "&" character it returns & instead. Can someone help here? Here is the current code: $getMainCats = mysql_query("SELECT id,name,issubcat FROM SAMPLE_categories WHERE parent=0 ".$adCatQuery." ORDER BY theorder ASC, name ASC"); $cnt = 0; $catId = array(); $hasSubcat = array(); while ($row=mysql_fetch_array($getMainCats)) { $catId[$cnt]=$row['id']; $hasSubcat[$cnt]=$row['issubcat']; $cnt++; } Quote Link to comment https://forums.phpfreaks.com/topic/156324-html-characters-converting/ Share on other sites More sharing options...
gffg4574fghsDSGDGKJYM Posted April 30, 2009 Share Posted April 30, 2009 This should solve your problem : http://www.php.net/manual/en/function.html-entity-decode.php Quote Link to comment https://forums.phpfreaks.com/topic/156324-html-characters-converting/#findComment-823088 Share on other sites More sharing options...
monkeybidz Posted April 30, 2009 Author Share Posted April 30, 2009 Thanks for the link, I still don't know what to do or how. Quote Link to comment https://forums.phpfreaks.com/topic/156324-html-characters-converting/#findComment-823100 Share on other sites More sharing options...
mikesta707 Posted April 30, 2009 Share Posted April 30, 2009 well since & is the character entity for the & character, all you would really need to do is a string replace. just replace the & with & Quote Link to comment https://forums.phpfreaks.com/topic/156324-html-characters-converting/#findComment-823116 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.