---
title: "Discussion on \"What is the difference between print-r(), var_dump(), and var_export() in PHP?\" | Hashnode"
description: "Discussion on \"What is the difference between print-r(), var_dump(), and var_export() in PHP?\". They are mainly used to output a structured view of arrays and objects."
url: "https://hashnode.com/posts/what-is-the-difference-between-print-r-vardump-and-varexport-in-php/63eb6cffac56fc6d42a9164c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [What is the difference between print-r(), var\_dump(), and var\_export() in PHP?](https://habibawael.hashnode.dev/what-is-the-difference-between-print-r-vardump-and-varexport-in-php?utm_source=hashnode&utm_medium=feed)

They are mainly used to output a structured view of arrays and objects.

Feb 14, 2023 · 3 min read · habibawael.hashnode.dev  
Read the article

-   [#php](https://hashnode.com/tag/php)
-   [#beginners](https://hashnode.com/tag/beginners)

## Written by

[Habiba Wael](https://hashnode.com/@HabibaWael)

@HabibaWael

  
[View profile](https://hashnode.com/@HabibaWael)

Web Development

Hey, I am Habiba. 2⃣ 1⃣ year old full-time learner. 🎓College senior and UX developer intern. 💻 Self-taught web developer. 📚 I love reading, coffee, and discovering new things.

## Responses 1

Markdown supported · ⌘↵ to post

[Belal Elsayed](https://hashnode.com/@BELAL2024)

[Feb 24, 2024](https://hashnode.com/posts/what-is-the-difference-between-print-r-vardump-and-varexport-in-php/63eb6cffac56fc6d42a9164c/comment/65da3b16f3e813856a44ed11)

this article is awesome thanks a lot

[Habiba Wael](https://hashnode.com/@HabibaWael)

[Feb 25, 2024](https://hashnode.com/posts/what-is-the-difference-between-print-r-vardump-and-varexport-in-php/63eb6cffac56fc6d42a9164c/comment/65da3b16f3e813856a44ed11#reply-65daa7d989b395f04d325b5e)

Thank you for the comment. Happy to help!
