CS 1425 Lecture 4: Arrays and Conditional Statements - PHP

20 views2 pages

Document Summary

Array is a special variable, vihich can hold more than one vahre at a time. Numeric or hdexed arrays associate a m:meric index with their values. The index can be assigned automatically (index always starts at 0), fike this: fex =array("davidn, Alternatively, you can assip. yu:r index manually: oamy*,"john"); : l-ex: [o] ="david";-l. We defined an array c*lled that stores three values" ycnr can access the array elements tkorgh their indices. You can have iategers, strings, and other data g"pes together in one array. | // grputs "john is 2l and knows piip" Associative arrays arc arrerys that use named keys that you assign to &em. There arc tsro ways to create an associative array: u, ft*, : array("david o=>"21o, namy"r:;r2. A m{tidimensimal rray contains one or more arrays. I: the trvodimensional "ople array above contains 3 arrays, and it bas two indices: row and cohmn- r^\*--- lctr conditimal statqrmts, conditimal perform different actims for different fuisions.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers