Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to get selected number of indexes/key from a array

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 189
    Comment on it

    If you need to get some limited key values of an array then you can use function array_slice used in PHP

    Let see the example I'm having an array of 400+ values

    $exp = array("34", "45", "45", "554", "2".......);
    

    Now I'm limiting my this $exp array to top 200 vales only

    the new array will go like this

    $limited_exp = array_slice($input, 0, 200);  
    

    Now new array will have only first 200 records of older array.

 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: