recent searches:
include functions ,
variable functions ,
post functions...
If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.
PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.
PHP 5 provides a way for objects to be defined so it is possible to iterate through a list of items, with, for example a foreach statement. By default, all visible properties will be used for the iteration.
As the output shows, the foreach iterated through all
visible variables that can be
accessed. To take it a step further you can implement one
of PHP 5's internal interface named
Iterator. This allows the object to decide what and how
the object will be iterated.
Example 19-23. Object Iteration implementing Iterator
The above example will output:
|
You can also define your class so that it doesn't have to define
all the Iterator functions by simply implementing
the PHP 5 IteratorAggregate interface.
Example 19-24. Object Iteration implementing IteratorAggregate
The above example will output:
|
Note: For more examples of iterators, see the SPL Extension.
Another Useful functions:
language.oop5.visibility | language.oop5.typehinting | language.oop5.static | language.oop5.reflection | language.oop5.patterns | language.oop5.paamayim-nekudotayim | language.oop5.overloading | language.oop5.object-comparison | language.oop5.magic | language.oop5.iterations | language.oop5.interfaces | language.oop5 | language.oop5.final | language.oop5.decon | language.oop5.constants | language.oop5.cloning | language.oop5.basic | language.oop5.autoload | language.oop5.abstract |
PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.