0% found this document useful (0 votes)
45 views2 pages

Variables - Variables

The document demonstrates how to use variables and arrays in PHP. It defines several arrays, prints them out using print_r(), and demonstrates how to access array elements, add new elements, and unset elements. It also shows defining a variable and unsetting it to set it to null.

Uploaded by

MirunaCatiche
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views2 pages

Variables - Variables

The document demonstrates how to use variables and arrays in PHP. It defines several arrays, prints them out using print_r(), and demonstrates how to access array elements, add new elements, and unset elements. It also shows defining a variable and unsetting it to set it to null.

Uploaded by

MirunaCatiche
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Variables with PHP: variables.

php
!

<?php

$myArray=array("pizza", "chocolate", "coffee");

print_r($myArray);

echo $myArray[5];

echo "<br /><br />";

$anotherArray[0]="pizza";

$anotherArray[1]="yoghurt";

print_r($anotherArray);

echo "<br /><br />";

$thirdArray=array(

"France" => "French",
"USA" => "English",
"Germany" => "German"


);

print_r($thirdArray);

$anotherArray[]="salad";

echo "<br /><br />";

print_r($anotherArray);

echo "<br /><br />";

unset($thirdArray["Germany"]);

print_r($thirdArray);

echo "<br /><br />";

$name="Rob";

unset($name);

echo $name;


?>

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy