Page 151 - Open Soource Technologies 304.indd
P. 151
Unit 6: Arrays
Map: A map is a type that associates values to keys. This type is optimized for several different Notes
uses; it can be treated as an array, list (vector), hash table (an implementation of a map),
dictionary etc.
range( ): The range( ) function creates an array of consecutive integer or character values between
the two values you pass to it as arguments.
Split: Split command have been used to brake $TheText and “ “ (space) has been used as a
delimiter to separate the substrings.
1. Develop a PHP program to add two arrays.
2. Develop a PHP program to found the size of an array.
6.8 Review Questions
1. What are the indexed and associative arrays? Explain with example.
2. What are the ways to identifying elements of an array?
3. Write a PHP program to search a special element in an array?
4. How do we store the data in arrays?
5. Write a PHP program to adding values at the end of an array.
6. What is the padding of an array? Explain with example.
7. How do we perform array operations in PHP?
8. Write a PHP program to sort an array.
9. Write a PHP program to merge two arrays.
10. Write the concepts working with array?
Answers to Self Assessment
1. (c) 2. (a) 3. (a) 4. (a) 5. (a)
6. (a) 7. (a)
6.9 Further Reading
Web Database Applications with PHP and MySQL, by Hugh E. Williams, David
John Lane.
http://www.phpf1.com/tutorial/php-array.html
LOVELY PROFESSIONAL UNIVERSITY 145