Variables

Simple Variable
<?php
$myvar = 'Hello World !';
echo $myvar;
?>
outputs: Hello World !

Math
<?php
$myvar1 = '1';
$myvar2 = '2';
$mytotal = $myvar1 + $myvar2;
echo $mytotal;
outputs: 3
?>

Create Html Variables
<?php
$header_doc = '<!DOCTYPE html>';
$html = '<html>';
$title = 'SiteName';
$body = '<body>';
$content = '<div><h1>My Site</h1><br /><p>Welcome !</p></div>';
$footer = '<div>copywrite@2014 mysite.com</div>';
$body_end = '</body>';
$html_end = '</html>';
?>
For Testing Exercises
For testing many of the scripts seen here use the following link and or follow the directions listed below it to use the XAMP Php, Apache and Mysql database engine.
http://writecodeonline.com/php/
Build Your Own Php Server
Xamp is a very unique Php server which allows Windows and or Linnox to work with Php for developing or testing Php websites or applications. It can be downloaded here at-- Xamp-- provided you follow the directions to the letter so read away. Espeacially windows users you will need to download one of the following Microsoft runtime versions for iis.
1-->The Microsoft Visual C++ 2008 Redistributable Package (x86) 
or 
2--> The Microsoft Visual C++ 2008 Redistributable Package (x64) which both build a light partition within your program files to safely run the server.

No comments:

Post a Comment