title: how to replace special chars in php
body: <p>I have a code that i have to replace few special chars:
  code below:</p>
  
  <pre><code>#include &lt;iostream&gt;\012#include &lt;stdio.h&gt;\012#include &lt;stdlib.h&gt;\012#include &lt;limits&gt;\012#include &lt;string.h&gt;\012using namespace std;\012\012void inclean(){\012\011std::cin.ignore(std::numeric_limits&lt;std::streamsize&gt;::max(), '\\n');\012}\012\012void die(string e){\012\011//cout &lt;&lt; e;\012\011exit(1);\012}\012\012typedef struct {\012\011bool zajente;\012\011int rozmiar;\012} pudelko;\012\012int main() {\012\011int i = 12;\012setvbuf(stdout, NULL, _IONBF, 0);\012\011setvbuf(stderr, NULL, _IONBF, 0);\012\011int a;\012\011int lamount=0;\012\011cin &gt;&gt; a;\012\011if(!(a&gt;=1&amp;&amp;a&lt;=1000000)){die("Liczba mo\277e wynosi\346 od 1 do 1000000(10^6)");}\012\011pudelko  *pudelka=new pudelko[a];\012\011memset (pudelka,0,a*sizeof(pudelko));\012\011string b;\012\011inclean();\012\011getline(cin,b);\012\011int bl=b.length();\012\011for(int i=0;i&lt;=bl;i++){\012\011\011char c=b.c_str()[i];\012\011\011if (c&gt;=48&amp;&amp;c&lt;=57){\012\011\011\011pudelka[lamount].rozmiar*=10;\012\011\011\011pudelka[lamount].rozmiar+=(int)c-48;\012\011\011\011pudelka[lamount].zajente=false;\012\011\011} else {\012\011\011\011if(!(pudelka[lamount].rozmiar&gt;=1&amp;&amp;pudelka[lamount].rozmiar&lt;=1000000000)) die("Liczba mo\277e wynosi\346 od 1 do 1000000000(10^9)");\012\011\011\011lamount++;\012\011\011\011if(lamount&gt;=a) break;\012\011\011}\012\011}\012\011int cpa=lamount;\012\011int e=0;\012\011while (true){\012\011\011for(int z=e;z&lt;=cpa;z++)\012\011\011\011if(pudelka[z].rozmiar&gt;pudelka[e].rozmiar&amp;&amp;!pudelka[z].zajente){\012\011\011\011\011pudelka[z].zajente=true;\012\011\011\011\011lamount--; break;\012\011\011\011}\012\011\011if(e&gt;=cpa){ cout &lt;&lt; "" &lt;&lt; lamount+1; break; }\012\011\011e++;\012\011\011}\012\011exit(0);\012\011return(0);\012}\012
  </code></pre>
  
  <p>what i tried to remove \012 and \011 was</p>
  
  <pre><code> $this-&gt;data['StoredFile']['data'] = str_replace("\012","\n",$this-&gt;data['StoredFile']['data']);
   $this-&gt;data['StoredFile']['data'] = str_replace("\011","\t",$this-&gt;data['StoredFile']['data']);
  </code></pre>
  
  <p>Also used </p>
  
  <pre><code>$this-&gt;data['StoredFile']['data'] = stripslashes($this-&gt;data['StoredFile']['data']);
  </code></pre>
  
  <p>wchich removed \0 and then by str_replace i removed 11 and 12... but i noticed that for e.x. int i = 12;  was changed to int i = \n; what i dont wont to happen ;&lt; </p>