Answers for "array[0] as $key => $value in php"

PHP
2

array values php

<?php
  
$array = array("size" => "XL", "color" => "gold");

print_r(array_values($array));

?>
Posted by: Guest on June-01-2020
1

php variables as keys in arrays

$id = 1;
$age = 2;    
$sort = "id"; // or "age";
    $Key = $$sort;
$arr = array($Key => 'string');

print_r($arr);
Posted by: Guest on August-13-2020

Browse Popular Code Answers by Language