Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use end() finction in php ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 106
    Comment on it

    Hi Reader's,
    Welcome to FindNerd, today we are going to discuss about end() function.

    The end() function is used for printing last element of an array.
    It is advances array s internal pointer to the last element.

    syntax of end() function

    end(array)
    

    array is required parameter

    you can see bellow example:

    <?php
    //here define a variable of array
       $data = array(
        'Emp_name' => 'Roy',
        'Emp_age' => 30,
        'Emp_dep' => 'account', 
    );
    //here call end() move the internal pointer to the end of the array
    echo end($data);  
    ?>
    

    output will come following of above example

    account
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: