Answers for "php is in array assoc"

PHP
1

php check array is not associative

count(array_filter(array_keys($array), 'is_string')) === 0
Posted by: Guest on September-03-2020
5

how to create an associative array in php

<?php
	$associativeArray = [
        "carOne" => "BMW",
        "carTwo" => "VW",
        "carThree" => "Mercedes"
    ];
    
    echo $associativeArray["carTwo"] . " Is a german brand";
?>
Posted by: Guest on February-18-2020

Browse Popular Code Answers by Language