Articles: 843 | Categories: 148   
   
   
Home Articles Contact Us
 
 
 
 
Save Information to a Cookie (0 Comments)
Admin: Posted Date: March 3, 2010

This snippet shows how you can easily save information to a cookie. More informatiom about cookies can be found on the site.

Add an Item to an Array

  Code Snippet  

<?php

// this declares and fills the array
$arrFood = array("Apples", "Oranges", "Pears", "Grapes");


// use the brackets empty to add an item
$arrFood[ ] = "Steak";

// now Steak has been added to the array
?>

To use the code above, click and drag your mouse over the code to highlight it.   Then right click on the highlighted code and click "Copy."   Now you may paste it into your code editor. 

 
 
Add a Comment:
 
(You must be signed in to comment on an article. Not a member? Click here to register)
   
Title:

Comments: