title: Reverse a string in php without using any string function
body: <p>In yesterday Interview I was asked that how to reverse a string with out using any string function like strrev() or strlen(). I found this example on website but it gives error.is it possible to do this without strlen().</p>
  
  <blockquote>
    <p>Uninitialized string offset: -1 in
    D:\xampp\htdocs\PhpProject1\index.php on line xx</p>
  </blockquote>
  
  <pre><code>$string = "ZEESHAN";
  
  $i =0;
  
  while(($string[$i])!=null){
  
          $i++;
  
  }
  
  $i--;
  
  while(($string[$i])!=null){
  
          echo $string[$i];
  
  $i--;
  
  }
  </code></pre>