Note: The archives category content is an automatically generated focus channel and does not neccessarily reflect the opinions of this blog. No responsibility is taken for the external links presented here, follow at your own discretion.
The archives content is never scraped from sites - but an abstract obtained from search engines.
| Problem |
Solution |
Example |
Reference |
Recommended |
PHP can handle number or string indexed arrays. Arrays can be initialized in a number of ways. For example: Basic array assignment and initialization, without specify numbers or strings: <?php $names[]=”joe”; $names[]=”john”; $names[]=”jim”; ?>
|
|
| Problem |
Solution |
Example |
Reference |
Recommended |
Specifically assigning values to numbered elements in the names array: <?php $names[0]="joe"; $names[1]="john"; $names[2]="jim"; ?> Quicker way to assign values to names array: $names=array("joe","john","jim"); Assigning values to a string indexed array - or hash (key and value pairs): <?php $addresses=array( "joe" => "1 Marble Street", "john" => "12 Marble Street", "jim" => "23 Marble Street" ); ?>
|
Leave a Reply
You must be logged in to post a comment.