Having trouble with data validation in Php for a online store

I have to create a website for a school project and I am making a guitar shop. The problem is I have having trouble with data validation when a user selects the amount they want to buy. My current code is

<html>
  <head>
    <meta charset="UTF-8">
    <title></title>
 <h1>Welcome to the Acoustic Guitar Shop!</h1>
</head>
<body>
<form action = '<?php $_SERVER['PHP_SELF'] ?>' method = 'post'>

    <?php

$Guitar1=array('Item'=>1,
'Guitar Type'=>"Fender FA-100 <img src=FenderFA100.jpg width='128' 
 height='128'>",
'Price'=>150);
$Guitar2=array('Item'=>2,
'Guitar Type'=>"Yamaha FG800 <img src=Yamaha800.jpg width='128' 
 height='128'>",
'Price'=>200);    
$Guitar3=array('Item'=>3,
'Guitar Type'=>"Yamaha FG830 <img src=Yamaha830.jpg width='128' 
 height='128'>",
'Price'=>299.99);
$Guitar4=array('Item'=>4,
'Guitar Type'=>"Big Baby Taylor <img src=Taylor.jpg width='128' 
 height='128'>",
'Price'=>399.99);
$Guitar5=array('Item'=>5,
'Guitar Type'=>"Martin DX1KAE <img src=MartinDX1AE.jpg width='128' 
 height='128'>",
'Price'=>599.00);
// Setting Up the Multi Dimentional Array

$Guitars=array($Guitar1, $Guitar2, $Guitar3, $Guitar4, $Guitar5);

// Creating a array for all Guitars.
echo "<center>";
echo "<table border='3' cellpadding='5' cellspacing='5'>";
echo '<th>Item</th><th>Guitar Type</th><th>Price</th><th>Quantity</th>';
//Creating borders and heading for table.

  for($i=0; $i<count($Guitars); $i++)

  {  
   $qty = "quantity" . $i;
  }

  foreach($Guitars as $i=>$Value)
  {

   echo "<tr><td>{$Guitars[$i] ['Item']}</td>";
   echo "<td>{$Guitars[$i] ['Guitar Type']}</td>";
   echo "<td>{$Guitars[$i] ['Price']}</td>";
   echo '<td><input type="text" name='. $qty .'></tr>';
  }
//Creating a for loop to display the table.  
//Created html forms to allow the user to choice the amount of guitars they 
wish to purchase.              

if(array_key_exists('submit_button' , $_POST))
// IF statement that tells the program to display a html table if the user 
presses submit
{
If(is_numeric("$qty"))   
{$error_found=False;
  echo "<table <table border='3' cellpadding='5' cellspacing='5'>
       <th>Item</th><th>Guitar Type</th><th>Price</th><th>Extended 
Price</th>";

//The submit_button input was valid, so it would display the invoice.  
}
else
{
$error_found=TRUE;
echo 'Value entered is invalid';
}
//Checking data validation.

}
 //Creating a if statement for the submit_button.
  else {   


       }
?>
<b><center><input type="submit" name = "submit_button" value = "Purchase">
</center></b>


   </form>
     </body>
 </html>

The main problem I have is with my last if statement, it keeps saying the value is invalid even though it is valid and I am not sure how to properly fix it.
I am new to coding so I am not sure how to fix this. I need to also display a invoice after using to display the final price of the items the user selected. How would i go about doing this?

Thanks in advance!

Change your line If(is_numeric("$qty")) to if(is_numeric($qty)) as you aren't actually comparing the variable you are actually checking the string "$qty".

EDIT

If you want to get the form value for the element with the name = $qty you need to use post variables. try if(is_numeric($_POST[$qty])) This should get the textbox value with the name "quantity5".

Good luck.

You are writing the validation is if there is only one qty variable, but in fact, you have 5, named quantity1 to quantity5. You need a loop to validate each one of them. Remember you can use dynamic variable names in PHP using a syntax like $_POST[${'quatity'.$index}] to access the variables in you _POST array.