Activity Stream
48,167 MEMBERS
63694 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 6 of 6

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1.     
    #1
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com

    Default Do you use these PHP functions with arrays ??

    Ok so ill tell you the truth here.. i never heard of these functions until erlier today lol

    what this basically does is allow you to paginate an array.. yes paginate

    here's the function list and then some examples of them

    PHP Code: 
    next();
    prev();
    current();
    reset();
    end(); 
    heres some usage examples

    PHP Code: 

    $array 
    = array('litewarez','katz','phaze','others');
    //Next
    echo current($array);//litewarez
    echo next($array); //katz
    echo end($array);  //others
    echo prev($array); //phaze
    echo reset($array);//litewarez

    next($array);
    next($array);
    next($array);
    prev($array);
    next($array);

    echo 
    current($array); // others 
    this navigation is stored like sessions so your position is always held.

    heres a full example of usage

    PHP Code: 
    $aFruit = array ('Tried' => array('Apple''Kiwi'),
                        
    'Not Tried' => array('Pear''Orange''Banana')
                         );

    while(
    $aChild key($aFruit))
    {
        while(
    $szItem current($aFruit[$aChild]))
        {
            echo 
    current($aFruit[$aChild]) . '<br />';
            
    next($aFruit[$aChild]);
        }
        
    next($aFruit);

    hope i brought a little more tips to the table
    litewarez Reviewed by litewarez on . Do you use these PHP functions with arrays ?? Ok so ill tell you the truth here.. i never heard of these functions until erlier today lol what this basically does is allow you to paginate an array.. yes paginate here's the function list and then some examples of them next(); prev(); current(); Rating: 5
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  2.   Sponsored Links

  3.     
    #2
    Respected Developer
    Website's:
    PlatinumW.org NexusDDL.com HD-United.org CheckLinks.org FLVD.org
    Nice one dude.

  4.     
    #3
    The Wise One
    Website's:
    twilight.ws ddlrank.com
    z0omg it's litewarez with another great piece of code
    PS: Never heard of it either.
    I can always be contacted by sending a tweet @twilightws

  5.     
    #4
    Respected Developer
    Website's:
    X4B.org
    I prefer not to, really there is no point for most applications, foreach is faster.

  6.     
    #5
    Member
    Website's:
    hostero.net
    99% of php prebuilt functions are faster than the one we build, so I will consider this. thanks

  7.     
    #6
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    so when usung a foreach loop your going threw a whole array but by using these functions php will remember the current position the you navigated to. aka the word pagination
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. (VB6) Using functions
    By JasonCairns in forum Web Development Area
    Replies: 0
    Last Post: 10th Jan 2012, 01:10 PM
  2. [For Hire] PHP Functions
    By _Vick in forum Completed Transactions
    Replies: 0
    Last Post: 3rd Dec 2011, 10:28 AM
  3. PHP Functions
    By Hydrode in forum General Discussion
    Replies: 3
    Last Post: 7th Feb 2011, 08:05 PM
  4. Who Knows This Functions In phpBB3 ?
    By netmonster in forum phpBB
    Replies: 6
    Last Post: 28th Apr 2010, 11:02 AM
  5. 2 functions 1 onclick ?
    By Porsche_maniak in forum Webmaster Discussion
    Replies: 8
    Last Post: 14th Apr 2010, 07:58 PM

Tags for this Thread

BE SOCIAL