Register if You want to join the community.
toolbar powered by Conduit
Programming Guides!
April 20, 2024, 06:14:42 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to Programming Guides!
 
  Home   Forum    Forum   Help Search Arcade Site BIO Gallery Scripts Filefront Staff List Login Register  

Tutorial 3 - Variables.

Pages: [1]
  Print  
Author Topic: Tutorial 3 - Variables.  (Read 371 times)
Hondaman
Administrator
Full Member
*

Karma: +200/-0
Offline Offline

Posts: 98



View Profile WWW
« on: January 08, 2010, 01:27:58 pm »

Hi there and welcome to your third PHP tutorial,
In this tutorial i will show you how to create and output a variable in PHP.
So to start off put the starting and ending PHP tags.
Code:
<?php

?>


Now to start a variable you need to put a "$" then the variable name
so it should look like this "$varname" then you need to set it equal to something.
Aubviously to do this you just put an equals sign and then the value, then a semi-colon.
now your script should look like this
Code:
<?php
$varname 
5;
?>


Now to output it.
Just type echo then the varaible so it looks like this.

Code:
<?php
$varname 
5;
echo 
$varname
?>


But there is no semi-colon after "echo $varname"
Then run this script and it should output
5

Thanks for viewing this tutorial.
PHP tut 3.
Your Admin; Hondaman.

Report Spam   Logged



Share on Facebook Share on Twitter



Pages: [1]
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy