Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Some about PHP Basics
04-28-2011, 12:06 AM
Post: #1
Some about PHP Basics
Now I m sharing about Some basic about Php:
- Never forgot use a "$" sign before any variable.
In Php:
-Echo statement is used to print something on screen link as:
<?php
echo "Hi, Every one";
?>
the out put of this line is-
Hi, Every one
- in Php we can also use control statements like as we used in c and c++:
If, if else, switch condition;
- in Php there is we can also use Loop condition as we used in c and c++;
for, while, do while;
but in Php we use an extra loop statement also "foreach" statement for fetching the data from an array like this:
foreach ($array as $value)
{
code to be executed;
}
for example if we have an array animal(cat, dog, cow) and we want to print then
<?php
$animal=array("cat","dog","cow");
foreach ($x as $value)
{
echo $value . "<br />";
}
?>
the out put will be:
cat
dog
cow



to be continued in up coming post..................
Visit this user's website Find all posts by this user
Quote this message in a reply
04-30-2011, 06:29 PM
Post: #2
Re: Some about PHP Basics
Good post Tongue

Wrap the codes in

[Image: k9zyqe.png]
UndergroundHipHop.me - Underground Hip Hop Blog
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)