Posted inphp

How to print or echo all the values of an array in PHP?

Today, We want to share with you echo array in php.In this post we will show you associative array in php, hear for php multidimensional array we will give you demo and example for implement.In this post, we will learn about PHP Arrays Example Tutorial For Beginners From Scratch with an example.

How to echo or print an array in PHP?

Also You can use print_r, var_dump and var_export funcations of php:

Example 1: using foreach

foreach($up_comming_movies['data'] as $result) {
    echo $result['type'], '
'; }

Example 2: using print_r

echo '
'; print_r($up_comming_movies); echo '


$up_comming_movies = ["a", "b", "c"];

echo "
echo "



    [0] => a
    [1] => b
    [2] => c

Example 3: using json_encode

echo json_encode($up_comming_movies);

using var_dump();


PHP Arrays Example

Example of Displaying the PHP Array Values


I hope you get an idea about php get array value by key.
I would like to have feedback on my 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 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