- var_dump: documentation ( source)
- in_array: documentation ( source)
<?php
$people = array("Peter", "Joe", "Glenn", "Cleveland");
if (in_array("Joe", $people))
{
if(count($people == 3)){
$people = ["1","2","3","4"];
$people['keyhave'] = $people;
}else if(count($people == 5 )){
$people = "string is here";
$people['keyhave'] = $people;
}
}
var_dump($people['keyhave']);