1$array = array(0 => 100, "cor" => "vermelho");
2print_r(array_keys($array));
3
4$array = array("azul", "vermelho", "verde", "azul", "azul");
5print_r(array_keys($array, "azul"));
6
7$array = array("cor" => array("azul", "vermelho", "verde"),
8 "tamanho" => array("pequeno", "medio", "grande"));
9print_r(array_keys($array));
10
1<?php
2$age=array("Peter"=>"35","Ben"=>"37","Joe"=>"43");
3foreach($age as $x=>$x_value)
4 {
5 echo "Key=" . $x . ", Value=" . $x_value;
6 echo "<br>";
7 }
8?>
1$healthStructureData = [
2 'product' => $product,
3 'website_data' => $website_data,
4 'total_keywords' => $total_keywords,
5 'certificate_status' => $certificate_status,
6 'total_user_websites' => $total_user_websites,
7 ];
8
9foreach ($healthStructureData as $key => $value) {
10 $$key = $value;
11}
1$id = 1;
2$age = 2;
3$sort = "id"; // or "age";
4 $Key = $$sort;
5$arr = array($Key => 'string');
6
7print_r($arr);
1function myfunc(){
2 $arr = array();
3 $arr[] = 'value0';
4 $arr['key1'] = 'value1';
5 $arr['key2'] = 'value2';
6 $arr[] = 'value3';
7 return $arr;
8}
9
1foreach($bigArray as $array){
2 foreach($array as $key=>$value){
3 echo $key;
4 }
5}
6
7
8#If if helps you give it Thumbs up