PHP

285
2811 reads

January 16, 2013

Print "Hello World!" three times.


This code prints "Hello World!" three times.

365
3085 reads

January 16, 2013

foreach


The following code shows the use of foreach statement in php.

334
4491 reads

January 16, 2013

Sort an array by keys


This code demonstrates how an array is sorted by keys.

243
3394 reads

January 16, 2013

Accessing array elements into variables


Using the "list" statement the values in the array are accessed in variables.

191
2447 reads

January 16, 2013

Sort an array with words for keys


The asort statement is used to sort an array with words for keys. The array is sorted according to values and the original keys are retained for the values.

63
1530 reads

January 16, 2013

Sort an array


This code shows how to sort an array in php.

396
4608 reads

January 16, 2013

Removing values from arrays


This code shows how to delete a particular element from an array in php.

71
1588 reads

January 16, 2013

Display Array Elements


This code shows how to display the elements of an array using print_r and var-dump commands respectively.

391
2660 reads

January 16, 2013

Declare array using words for keys


This example demonstrates declaration of arrays using words as keys instead of numbers. Also the array elements are printed using the words as indexes.

213
3121 reads

January 16, 2013

Declare and print array elements


This code demonstrates how to declare an array and print the corresponding elements.