Tuesday, 9 June 2020

introudcion php

print "vamsikrishna";
sting in double quotes with semi colon
print or echo
it will print the string in the double quotes in display
echo and print are more or less the same. They are both used to output data to the screen.
The echo statement can be used with or without parentheses: echo or echo().
semicolon ends a statement  or before a statement of next line
vamsikrishnakrishnavamsi
vamsikrishna  krishnavamsi
space is used for if we require space
<?php
echo "vamsikrishna";
vamsikrishnakrishnavamsi
echo "krishnavamsi";
?>
space created
<?php
echo "vamsikrishna";
vamsikrishna  krishnavamsi
echo "  krishnavamsi";
?>
to print in next line
<?php
echo "vamsikrishna<br>";
echo "  krishnavamsi";
?>
single quotes vs double quotes
use single quotes outside, double quotes inside
single quotes
<?php
echo 'vamsikrishna<br>';
echo 'krishnavamsi';
?>
echo "<input type="text" value="value" >";
if u use double quotes , it showung error
use escape character inside of html
echo "<input type=\"text\" value=\"username\"> ";
or
echo '<input type="text" value="value" >';
outside double quotes and inside single quotes,it good in differentiation
embededding html inside php
programm: declaredd html outside the php
<?php
?>
<input type='text' value='sameeer'>
change the html using php
<?php
$x= 'vamsi';
declaration of variable
?>
<input type="text" value="<?php echo $x ?>">
it will print the input box with variable value inside










how to print the name 
can we place semicolon at the end of each statement or if it has only one statements also it needs semicolon
how toprint a name in a same line
whats the procedure to create a space between two strings
how to print a strings in next line
can we use double quotes out side and single quotes inside
how can we use escape character instead of single quotes
how can we print the text using php from variable
how to declare variable




print








No comments:

Post a Comment