I am explaining you, how to get all the keys of an associative array in PHP. we need to use PHP array_keys() function to extract the keys in an associative array.
Example :
<?php
$websites = array("webdeveloperindia"=>"https://webdeveloperindia.in","pakizacity"=>"https://pakizacity.com","markdevelopments"=>"https://markdevelopments.com","wordpressminds"=>"https://wordpressminds.com");
print_r(array_keys($websites));
?>
Output :
Array ( [0] => webdeveloperindia [1] => pakizacity [2] => markdevelopments [3] => wordpressminds )
Otherway, I will apply foreach loop so it will also show key and its related values.
Example :
<?php
$websites = array("webdeveloperindia"=>"https://webdeveloperindia.in","pakizacity"=>"https://pakizacity.com","markdevelopments"=>"https://markdevelopments.com","wordpressminds"=>"https://wordpressminds.com");
foreach($websites as $key => $website){
echo $key . " : " . $website . "<br>";
}
?>
Output :
webdeveloperindia : https://webdeveloperindia.in
pakizacity : https://pakizacity.com
markdevelopments : https://markdevelopments.com
wordpressminds : https://wordpressminds.com
Hello, Welcome to webdeveloperindia.in. I am a full-stack web developer. Email – [email protected] | Skype – azaruddin23. I have knowledge of PHP, Laravel, Magento 1/2, Codeigniter, WordPress, Joomla, Shopify, Git, Bitbuket, jQuery, Ajax, Javascript and ReactJS.