Getting a notice on line 23 Notice: Undefined offset: 5? on line 23? Sorry I can't figure this one out can someone help me out? The top line and bottom line are spitting out just not the middle. THanks show added new code please
$mystring = "level"; 
echo "String: " . $mystring;
$str=$mystring;`enter code here`
$mystring = trim( preg_replace( "/[^0-9a-z]+/i", " ", $mystring) );
$myArray = array();
$myArray = str_split($mystring); 
$len = sizeof($myArray); 
$newString = "";
for ($i = $len; $i >= 0; $i--) {
  $newString.=$myArray[$i];
}
echo "<br>";
if ($mystring == $newString) {
  if ($str=$newString) {
    echo "Output: " . $mystring . " is a perfect palindrome";
  } else {
    echo "Output: " . $mystring . " is a Standard palindrome";
  }
} else {
  echo "Output: " . $mystring . " is not a palindrome";
}
 
     
    