title: How to print * in middle character of string array element if length is odd
body: <p>I want to print * in middle element of odd element of array. here is my code I'm not getting what is the condition I'm write on inner loop? if character length is 7 then how i print * on 4 number character.?</p>
  
  <pre><code> $strings = array("abcdef","abcde","qwert","abcdef","bat");
  
   for ($i=0; $i &lt;count($strings) ; $i++) { 
  
   $len = strlen($strings[$i]);
  
   if($len % 2 == 0)
    {
   echo "Chacater's are even&lt;br&gt;";
    }
  else{
  
   $string = $strings[$i];
  
   for($j=0; $j&lt;1; $j++)
   {
      $string[$j] = "*";
    }
  echo $string."&lt;br&gt;";
    }
  
    }
  </code></pre>