asmith Posted August 17, 2008 Share Posted August 17, 2008 Hey guys In some utf files (persian) , I see the word "عنوان" is written like "عنوان" . What is it call ? what's the function that convert "عنوان" to "عنوان" ?? THanks a lot Quote Link to comment Share on other sites More sharing options...
Mchl Posted August 17, 2008 Share Posted August 17, 2008 http://en.wikipedia.org/wiki/Unicode_and_HTML Quote Link to comment Share on other sites More sharing options...
asmith Posted August 17, 2008 Author Share Posted August 17, 2008 Thanks for the link. It is called HTML char (reference). But still didn't find any function in PHP. Quote Link to comment Share on other sites More sharing options...
DeanWhitehouse Posted August 17, 2008 Share Posted August 17, 2008 Can you not just set the charset to utf-8, and wouldnt this top any problem? Quote Link to comment Share on other sites More sharing options...
asmith Posted August 17, 2008 Author Share Posted August 17, 2008 i wish so. The file is written by someone else. my problem is, I have an array. It has like 300 values. all values are like "عنوان" (html numeric char) the array values are a html form select options. like : foreach ($array as $value) { echo <option value="$value" $selected>$value</option> } the thing is , in the foreach i'm putting : If ($value == $row[option]) { $selected = "selected"} now my $row[option] is "عنوان" . but the option that must match is "عنوان" . So i need to convert "عنوان" to html numeric char first , then do the IF statement. All i need is te function :/ mb_decode_numericentity and encode one do not work in my php version apparently :/ Quote Link to comment 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.