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>";
}
?>$id = 1;
$age = 2;
$sort = "id"; // or "age";
$Key = $$sort;
$arr = array($Key => 'string');
print_r($arr);array_keys ($array);
// It returns an array
// more informations at https://www.php.net/manual/fr/function.array-keys.php (fr)$healthStructureData = [
'product' => $product,
'website_data' => $website_data,
'total_keywords' => $total_keywords,
'certificate_status' => $certificate_status,
'total_user_websites' => $total_user_websites,
];
foreach ($healthStructureData as $key => $value) {
$$key = $value;
}function myfunc(){
$arr = array();
$arr[] = 'value0';
$arr['key1'] = 'value1';
$arr['key2'] = 'value2';
$arr[] = 'value3';
return $arr;
}
foreach($bigArray as $array){
foreach($array as $key=>$value){
echo $key;
}
}
#If if helps you give it Thumbs up
Also in PHP:
- Allowed memory size of 134217728 bytes exhausted setup di compile
- convert uppercase to capitalize in php
- db seed
- Fixes duplicate arrays to show a single character. php
- create model, controller and migration in single command laravel
- check isset key in array php
- SQLSTATE[42000] in laravel
- debuggin native php
- check if string contains only one word
- codeignitor get insert id
- check if string has symbol php
- Warning: get_browser(): browscap ini directive not set in
- cache refresg in laravel
- beforeHeader settings
- checking php version
- can you have more than one constructor in class php
- cron job in wordpress
- expression is not allowed as parameter
- 2 days in php
- array has key php
- disable register route laravel
- add 1 day to date php
- add one day to given date in php
- check a word in a string