Posted inphp

how to display array values in php

Today, We want to share with you how to display array values in php.In this post we will show you php echo array values foreach, hear for php get all values from multidimensional array we will give you demo and example for implement.In this post, we will learn about How to Print Arrays in PHP? with an example.

Display array values in PHP

Example 1: foreach loop in php

foreach($array as $key => $value)
{
  echo $key." has the value". $value;
}

consider using implode

$string=implode(",",$array);
echo $string;

//or

$withComma = implode(",", $array);

echo $withComma;
// Will display mobile,laptop,camero

Pre code

'mobile','b'=>'laptop','c'=>'camero');?>

How to echo or print an array in PHP?

Use the PHP foreach loop

";
}
?>

I hope you get an idea about How to print or echo all the values of an array in PHP?.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I'm a full-stack developer, entrepreneur and owner of Pakainfo.com. I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.

Leave a Reply

Your email address will not be published. Required fields are marked *

We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype