This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes PHP and the fly likes Problem in array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Languages » PHP
Bookmark "Problem in array" Watch "Problem in array" New topic

Problem in array

Aniket S. Kulkarni
Ranch Hand

Joined: Jun 15, 2011
Posts: 87


I need help on array.


Output:= 1234Array

I know $data is array it is not variable, but if I print as variable($data) result is Array. Why?

[Edit - added code tags - MB]

Aniket Kulkarni
Oracle Certified Professional, Java SE 6 Programmer.
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

pirnt just show you the variable type in case of array, and php has another function to print the array. print_r ($data);

[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Aniket S. Kulkarni
Ranch Hand

Joined: Jun 15, 2011
Posts: 87

I tried print_r($data); it is nice. It reduces overhead of writing each array element.
I agree. Here's the link:
subject: Problem in array
It's not a secret anymore!