CodeMama Posted June 29, 2009 Share Posted June 29, 2009 I am having problems with a special character (the little degree symbol) I need to strip it out, or get it to show up...here is my script so far: Or can I declare the UTF somewhere to handle special characters? Script: preg_match_all('/<p><font size="2" face="Arial, Helvetica, sans-serif">(.+)<br>(.+)<br>.+(\d+\/\d+\/\d+)\s(.+)<br>(.+)<br>.+Critical Violations Found:.+(\d+)(.+)Noncritical Violations Found:.+(\d+)/imsSU', $url, $results); for ($i=0; $i < count($results[0]); $i++) { $name = strtolower($results[1][$i]); $address = strtolower($results[2][$i]); $inDate = $results[3][$i]; $inType = $results[4][$i]; $notes = trim($results[5][$i]); $critical = trim($results[6][$i]); $cviolations = $results[7][$i]; $noncritical = $results[8][$i]; //trying to manipulate different field data $cleanViolations = str_replace('*', '', $cviolations); $ucName = ucwords($name); $ucAddress = ucwords($address); echo "$ucName <br>"; echo "$ucAddress <br>"; echo "$inDate <br>"; echo "$inType <br>"; echo "$notes <br>"; echo "$critical <br>"; echo "$cviolations <br><hr>"; echo "$cleanViolations <br><hr>"; echo "$noncritical <br>"; it's in the violations that sometimes the Fahrenheit symbol is used and it is outputing as a question mark.... help please Quote Link to comment https://forums.phpfreaks.com/topic/164117-dealing-with-special-characters-and-utf/ 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.