Jump to content

Dealing with Special Characters and UTF?


CodeMama

Recommended Posts

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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.