Jump to content

meneimoh

Members
  • Posts

    1
  • Joined

  • Last visited

About meneimoh

  • Birthday July 6

Previous Fields

  • Languages
    JavaScript, PHP,Java,Python,HTML,CSS

Contact Methods

  • Website URL
    http://zepstra.com/staff/franklin-fotang/
  • Skype
    ffotang

Profile Information

  • Gender
    Male
  • Location
    Buea, Cameroon
  • Interests
    Software Development, Hacking, System Analysis, Web Engineering

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

meneimoh's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. I had an array with duplicates. I removed the duplicates using PHP array_unique function. Then, I loop through the unique array using for loop (Sample Code below) and , I got an Undefined offset error. $even_numbers = array(22,66,24,22,36); $unique_even_numbers = array_unique($even_numbers); for($i=0; $i<count($unique_even_numbers); $i++){ echo $unique_even_numbers[$i].'<br>'; } The interesting thing is that I forgot I removed duplicates from the array somewhere (and therefore, an index). It took me something to figure out what was happening. I then used foreach. If I'm not missing something then I think it will be helpful if this is mentioned somewhere in the w3schools tutorial. It may help especially beginners.
×
×
  • Create New...