Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

explain why people do this

Posted on 2013-06-08
4
Medium Priority
?
394 Views
Last Modified: 2013-06-10
how do programmers write functions where they can call functions within other functions for example...

$className->functionName->anotherFunction->PassVariable('something');

is that even a class or am I looking at something wrong maybe its an array someone please explain this to me so I can get new ideas on coding..

Thanks Experts
0
Comment
Question by:Easyrider43
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39231420
Start your learning adventures here:
http://php.net/manual/en/language.oop5.php
0
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 39231427
In PHP, the -> is object-oriented notation.  It refers to a property or method of an object.  Properties are data elements.  Methods are functions.  All method names end in parentheses, with or without arguments inside the parens.  This notation is somewhat similar to the ['xxx'] notation that would refer to an array at the position denoted by the associative index xxx.

Like arrays, objects can have nested elements.  Objects can contain other objects and even arrays of objects.  The "depth" of this nesting is essentially unlimited (JSON imposes some limits, but they are so deep that nobody would ever hit bottom).

XML can be converted to PHP objects via SimpleXML.  The resulting objects may be nested in ways that are similar to your original example.  You can use iterators like foreach() to access the properties of the resulting objects.
0
 
LVL 1

Author Closing Comment

by:Easyrider43
ID: 39231434
very nice explanation, I love it.
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39234498
Thanks for the points, ~Ray
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question