Home > Enterprise >  Unable to print the value of variables in PHP
Unable to print the value of variables in PHP

Time:11-15

I don't know why it's happening I'm unable to print the value of color in my PHP code.

<?php
$x=array("red","blue","pink");
echo"Color names are <br>";
foreach(x as value){
echo "$value <br>";
}
?>

CodePudding user response:

Please correct this

<?php
$x=array("red","blue","pink");
echo"Color names are <br>";
foreach($x as $value){
echo "$value <br>";
}
?>

CodePudding user response:

If you want to learn PHP please switch on showing errors and warnings. It will help you.

  •  Tags:  
  • php
  • Related