- Edited
$numnames = 10;
for($i=1; $i <=$numnames; $i++){
$temp = "name$i";
echo htmlspecialchars($$temp).'<br/s>'; //or whatever processing you want to do
}
Warning: Undefined variable $name1 in /var/www/html/PHP-and-MySQL-Web-Development/Chapter01/exercise12/freight.php on line 39
Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/PHP-and-MySQL-Web-Development/Chapter01/exercise12/freight.php on line 39