Thursday, August 11, 2022

Associative Arrays in Php | PHP Tutorial #18

 


youtube:

https://www.youtube.com/watch?v=yJNeEGvskpw&list=PLu0W_9lII9aikXkRE0WxDt1vozo3hnmtR&index=18

Blogspot:

https://www.codewithharry.com/videos/php-tutorials-in-hindi-18/




<?php

echo "Welcome to associative array PHP tutorial class<br>";

$favcol = array("Sourav"=>"red",
                "Ram"=> "blue",
                "Pratyush" => "green");

//  echo $favcol["Pratyush"];      

foreach ($favcol as $key => $value) {
    echo "<br>Favourite colour of $key is $value";
}


?>

No comments:

Post a Comment