Approaches to Web Development for Bioinformatics

Previous  Contents  Next
References

Variables

A variable in PHP is written with a $ followed by the name of the variable.

PHP has a large number of predefined variables. The exact set of predefined variables depends on the particular environment in which the script is being run. The variable $_POST from the example form processing script above is an example of a predefined variable. In web environments PHP provides variables relating to the operating system environment, the web server, and the user input. $_SESSION is a useful variable relating to the user's HTTP session.

PHP also has the concept of variable variables using the $$ syntax. For example,


PHP

<?php
$symbol = 'dnasymbol';
$dnasymbol = 'a';
print $$symbol;
?>

This produces the output


Program output

a

Variables can be shared between processes by using the shmop or System V shared memory extensions. See the PHP Manual for details.


Previous  Contents  Next
References

Contributed Comments and NotesAdd a comment.

There are no user comments.

Google

Please send ideas and opinions by email at alexamies@gmail.com.

© 2006-2007 Alex Amies