|
|||||||||
|
|||||||||
ПримерыСодержаниеFor EachStarting with PHP 5, you may use PHP's own foreach statement to iterate over the contents of a standard COM/OLE IEnumVariant. In laymans terms, this means that you can use foreach in places where you would have used For Each in VB/ASP code.
Пример #1 For Each in ASP
<%
Set domainObject = GetObject("WinNT://Domain")
For Each obj in domainObject
Response.Write obj.Name & "<br />"
Next
%>
Пример #2 while() ... Next() in PHP 4
<?php
Пример #3 foreach in PHP 5
<?php | |||||||||
|
|||||||||