Skip to content

Instantly share code, notes, and snippets.

View ruslanashaari's full-sized avatar
🎯
Focusing

Ruslan Ashaari ruslanashaari

🎯
Focusing
  • Tata Consultancy Services
  • Kuala Lumpur
View GitHub Profile
@dahjelle
dahjelle / Array Exercises (PHP).markdown
Last active November 5, 2023 05:17
Array Exercises (PHP)

Array Exercises (PHP)

Questions

  1. If you have an array $a = array( 0, 1, 2, 3, 4 );, how do you extract the value 3 from the array?

  2. If you have an array $a = array( "zero"=>0, "one"=>1, "two"=>2, "three"=>3, "four"=>4 );, how do you extract the value 3 from the array?

  3. If you have the following array, how do you extract the value 3 from the array?

@rained23
rained23 / gist:8932657
Created February 11, 2014 10:40
Malaysia States Array
$states = [
'JHR' => 'Johor',
'KDH' => 'Kedah',
'KTN' => 'Kelantan',
'MLK' => 'Melaka',
'NSN' => 'Negeri Sembilan',
'PHG' => 'Pahang',
'PRK' => 'Perak',
'PLS' => 'Perlis',
'PNG' => 'Pulau Pinang',