Answers for "php to print key and value"

PHP
5

php foreach echo key value

foreach($page as $key => $value) {
  echo "$key is at $value";
}
Posted by: Guest on September-04-2020
3

array key value php

<?php
$age=array("Peter"=>"35","Ben"=>"37","Joe"=>"43");
foreach($age as $x=>$x_value)
  {
  echo "Key=" . $x . ", Value=" . $x_value;
  echo "<br>";
  }
?>
Posted by: Guest on March-12-2020

Code answers related to "php to print key and value"

Browse Popular Code Answers by Language