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

  • Home
  • SEARCH
  • 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 7964785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:58:50+00:00 2026-06-04T05:58:50+00:00

I have an array ($vEvents) as follows: Array ( [0] => Array ( [id]

  • 0

I have an array ($vEvents) as follows:

Array
(
[0] => Array
    (
        [id] => 1174
        [date] => 120411
        [name] => DR. J 'Souled Out' ~ 9pm (No Cover)
        [pubId] => 44
        [price] => 
    )

[1] => Array
    (
        [id] => 1108
        [date] => 120410
        [name] => Verb presents Open Stage ~ 9pm (No Cover)
        [pubId] => 44
        [price] => 
    )

[2] => Array
    (
        [id] => 1104
        [date] => 120409
        [name] => DR. J 'Souled Out' ~ 9pm (No Cover)
        [pubId] => 44
        [price] => 
    )
[currLimit] => 10
[eventsRemaining] => 4

I am echoing it to the screen with:

reset ($vEvents);
foreach ($vEvents as $key => &$value) {
    if ($key != 'currLimit' && $key != 'eventsRemaining'){ //Makes sure it doesn't print out the limiter value
    $m = substr($value['date'],0,2);
    $d = substr($value['date'],2,2);
    $y = '20'.substr($value['date'],4,2);
    echo date("D", mktime(0, 0, 0, $m, $d, $y)).", ".date("M", mktime(0, 0, 0, $m, $d, $y))." ".$d.", ".$y." - ".$value['name'].'<br />';
    }
}

But on my output, instead of getting all displayed array entries, it keeps skipping the first one… Output:

Sat, Dec 04, 2010 - Verb presents Open Stage ~ 9pm (No Cover)
Fri, Dec 04, 2009 - DR. J 'Souled Out' ~ 9pm (No Cover)

However, my expected output should be:

Sun, Dec 04, 2011 - DR. J 'Souled Out' ~ 9pm (No Cover)
Sat, Dec 04, 2010 - Verb presents Open Stage ~ 9pm (No Cover)
Fri, Dec 04, 2009 - DR. J 'Souled Out' ~ 9pm (No Cover)

I have tried changing the values in the name key and such, but all other entire show fine, it just always skips the first key. I have never had this issue before. Thoughts?

When I comment out the:if ($key != 'currLimit' && $key != 'eventsRemaining'){ //Makes sure it doesn't print out the limiter value line, it works fine. Is it relevant that the key of the first element is zero? But why would that fail my if check?

  • 1 1 Answer
  • 0 Views
  • 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-06-04T05:58:52+00:00Added an answer on June 4, 2026 at 5:58 am

    PHP is weird when it deals with values of 0… it treats them as false in most cases. So,

    if ($key != 'currLimit' && $key != 'eventsRemaining')
    

    is going to evaluate to false when $key == 0. I would change it to:

    if ($key !== 'currLimit' && $key !== 'eventsRemaining')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have array of select tag. <select id='uniqueID' name=status> <option value=1>Present</option> <option value=2>Absent</option> </select>
I have array object in jquery. array=[]; array{Id:user.Id,Date:user.Date}; Now am going to pass this
I have array [Company] => Demo Company 1 [First Name] => Test [Last Name]
I have array of Objects (let say that class name is Snap) Snap. Is
I have array of objects person (int age; String name;) . How can I
I have array like this: array( 'person0' => array( 'name'=>'name0','address'=>'address0' ), 'person1' => array(
I have array like below array(1) { [data]=> array(6) { [0]=> array(2) { [name]=>
I have array of text box <input type=text name=txt[] idtxt[] value=test 1 /> <input
I have array like this: $path = array ( [0] => site\projects\terrace_and_balcony\mexico.jpg [1] =>
I have array result like this: Array ( [0] => stdClass Object ( [id_global_info]

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.