file_get_contents and encoding
<p>i have an external webpage with some content like this:</p>

<pre><code>&lt;script&gt;
str = "hello";
fun('\202' + str + '\203\303\287');
&lt;/script&gt;
</code></pre>

<p>In my PHP page, I am trying to retrieve (a part of) the argument of <code>fun()</code> in the following way:</p>

<pre><code>$html=file_get_contents("webpage.html");
$regex_pattern = "/fun\(\'(.*)\'(.*)\'(.*)\'\)/";
preg_match_all($regex_pattern,$html,$matches);

$p1=$matches[1][0];
$p2=$matches[3][0];

echo "p1: ".$p1.", length: ".strlen($p1)."&lt;br&gt;";
</code></pre>

<p>What I get is that $p1 is equal to \202 and the length is 4. However, I would like to retrieve the character associated to \202 (and the same for the sequence of characters represented by $p2).</p>

<p>I browsed past questions related to similar matters but I was not able to get it working with the proposed solutions.</p>

<p>Any hints? </p>

<p>Thanks</p>
