Answers for "php foreach key => $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
2

php array sort by key value

To PHP sort array by key, you should use: 
	ksort() (for ascending order) or krsort() (for descending order). 
      
To PHP sort array by value, you will need functions:
	asort() and arsort() (for ascending and descending orders).
Posted by: Guest on October-23-2020
0

php array push key value

<?php
$image[0] = $image[0].','.$filename;
?>
Posted by: Guest on October-21-2020

Browse Popular Code Answers by Language