Llama!
Junior Member
Posts: 87
|
Post by Llama! on Sept 9, 2005 15:40:43 GMT
Hello! This tut is about the "basics" of php. Nothin much but you need to start somewhere If you make a php code you need to open the code with: <?php and close it with: ?> There are several ways to make comments, these are a few: <?php #this is a 1 line comment //also a 1 line comment /* multiple line comments */ ?> To get something on the screen we use echo. <?php echo "This is my first PHP code!"; ?> As you can see it has ; at the end. You end everything with ; Only if, else, for and while don't. Now let's start using variables. In variables you can store a little amount of data. Example: <?php $var = "This is a var!"; echo $var; ?> Now it will say This is a var! To "connect" a var and an echo you use a . Example: <?php $var = "This is a var!"; echo $var." This is not a var"; ?> With an if and else you can let it echo different stuff. Let's make an example with a var. <?php $var = "hello";
if($var == "hello"){ echo "The var has the text hello."; }else{ echo "The var does not have the text hello."; } ?> That was the basics Hope you understand
|
|