PHP doesn't detect white space in string
<p>I'm working on transferring data from one database to another. For this I have to map some values (string) to integers and this is where I run into a strange problem.</p>

<p>The string looks like this $string = "word anotherword"; so two words (or one space).
When I explode the string or count the amount of spaces it misses the white space. Why? I var_dumped the variable and it says it's a string. </p>

<p>Below is the code i'm using.</p>

<pre><code>echo "&lt;strong&gt;Phases&lt;/strong&gt;: ".$fases = mapPhase($lijst[DB_PREFIX.'projectPhase']);
</code></pre>

<p>The string that's being send to the function is for example "Design Concept". This calls the following function (where the spaces get ignored)</p>

<pre><code>function mapPhase($phases){
    echo "Whitespace amount: ".substr_count($phases, ' ')."&lt;br /&gt;";
}
</code></pre>

<p>For the example string given this function echoes 0. What's causing this and how can i fix it? The strangest thing is that for one instance the function worked perfectly. </p>
