Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 751147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:37:59+00:00 2026-05-14T14:37:59+00:00

I have an array result like this, example 1: Array ( [0] =>15 [1]

  • 0

I have an array result like this,
example 1:

Array ( [0] =>15 [1] => 16 [2] => 17 [3] => 18 )

example 2:

Array ( [0] =>15 [1] => 16 [2] => 17 [3] => 18 [4] => 18 )

The first array ends at array[3]
The second array ends at array[4]
How to calculate where the array ends
Is there any function to calculate this

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T14:38:00+00:00Added an answer on May 14, 2026 at 2:38 pm

    (Directly copied from http://www.php.net/manual/en/function.count.php)

    Depending on what do you mean by “end”,

    <?php
    $yourArray = array(1=>'a', 7=>'b', 5=>'c');
    
    print count($yourArray); // prints 3
    
    end($yourArray);
    print key($yourArray); // prints 5
    
    print max(array_keys($yourArray)); // prints 7
    ?> 
    

    For a normal array, just use count($a) - 1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have array result like this: Array ( [0] => stdClass Object ( [id_global_info]
I have an array which for arguments sake looks something like this: a =
I have an array that looks like this: [867324] [id] => 867324 [name] =>
If I have something like this from the server side, from a fetch: array(1)
I have an array with nested arrays that looks like this: var tw =
Using Jquery , I have an array result [<a href=><img src=image1></a>,<a href=><img src=image2></a>] if
I have an array which has the contents as the result of an sql
I have an array DetailsArray in VB.NET which contains the result of a LINQ
Now I currently have an array that contains 120 pairs. For example: [[1, 12],
I have a text file that looks like this: STUFF UP HERE APEXED NUMBER

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.