<?phpOk, now that said, let's go to what this tutorial was written for.
<?phpYou can also declare variables and then output them using the print function:
print("This is outputted to the webpage");
print "so is this!";
<?phpThat's really all there is to it. One thing is that it cannot be used in a variable function, which I'll explain in a few minutes.
$hello = "hello"
print("$hello"); //this print the hello variable
<?phpWhat's the difference between the two ? Well, one difference is that echo() can take multiple expressions:
$kool = "this is kool";
echo ("$kool prints \"kool\"");
echo "this does too!";
echo "this prints \"hello\" too!";
<?phpPrint cannot take multiple expressions. That is the main distinct difference!
echo "The first", "the second";
<?php function foo()In the code above there are two simple functions are declared. Then their names are assigned to the variable and both functions are executed using this variable. More Tutorials on roseindia.net for the topic PHP Introduction to PHP Echo and print Tutorial.
echo "In foo()\n";
function bar($arg = '')
echo "In bar(); argument was '$arg'.\n";
$func = 'foo';
$func = 'bar';
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.