SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru D-flyer's Avatar
    Join Date
    Jan 2001
    Location
    Near a computer
    Posts
    782
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    foreach in php4 = ........in php3

    Hello,

    I got a problem with php4 function foreach.

    My provider supports only php3,so how can i convert:
    PHP Code:
    foreach($existing_entries as $entry)//check each element.
            
    {
                
    //if file has /guestbook dont read it unless keep reading in $new_entries.
                    
    if(! ereg('</guestbook>',$entry) )
                {
                        
    $new_entries[] = $entry;
        }

    Into php3 valid???

    Grtz,
    D-flyer

  2. #2
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    This URL should help you out:

    http://www.php.net/manual/en/control...es.foreach.php

    It is using while, list, and each functions.

    -Peter


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •