welcome to tutorialfamily

php associative array

PHP associative Arrays – used to assign multiple name value in variable.


PHP associative Arrays

We can assign two way to associative array.

Single line associative array.

Manual associative array.


PHP Associative Arrays



<!DOCTYPE html>
<html>
<head>
	<title>PHP Associative Arrays</title>
</head>
<body>
// PHP Associative Arrays automatically<br>
<?php
	$model = array('BMW'>2020,'Toyota'=>2019);
?>	<br>
// PHP Associative Arrays manually<br>
<?php
	$model['BMW'] = "2020";
	$model['Toyota'] = "2019";
	echo "car ->".$model['BMW']." ";
	echo "car ->".$model['Toyota']." ";
?>					
</body>
</html>

output

Our Content