Solved

explain why people do this

Posted on 2013-06-08
4
376 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
  • 3
4 Comments
 
LVL 108

Expert Comment

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

Accepted Solution

by:
Ray Paseur earned 500 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 108

Expert Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now