Q1.What will be the output of the PHP code given below $v = 1; $m = 2; $l = 3; i
ID: 3571537 • Letter: Q
Question
Q1.What will be the output of the PHP code given below
$v = 1;
$m = 2;
$l = 3;
if( $l > $m > $v)
{ echo "yes";
}
Else
{
echo "no";
}
Q2. What is the output of the following PHP source code:
<!DOCTYPE html>
<html>
<body>
<?php
$txt = "Hello world!";
$x = 5;
$y = 10.5;
echo $txt;
echo "<br>";
echo $x;
echo "<br>";
echo $y;
?>
</body>
</html>
Q3. Write a PHP program to print:
Hello world!
Hello world!
Q4. Write a PHP program (using a function) to print the message “MY PHP FUNCTON”.
Q5.What is the output of the following script?
<!DOCTYPE html>
<html>
<body>
<?php
ECHO "apple<br>";
echo "apple<br>";
EcHo "apple<br>";
?>
</body>
</html>
Q6. What is the difference between Session and Cookie? How to set and retrieve cookies in PHP?
Q7. Write PHP Script for the following
i) Creating connection with MySQL Creating database tables Employee(emp_id,emp_name,emp_address,emp_salary,join_date,salary)
ii) Select database table Employee(emp_id,emp_name,emp_address,emp_salary,join_date,salary)
Explanation / Answer
Note:There are 7 questions in a single question,so i am doing first four parts of the question according to the chegg policy.
Answers:
1) syntax error, unexpected '>' on line 4
Reason:in the if condition you are using extra greater than operator .
2)Hello world!<br>5<br>10.5
3)
<?php
echo "Hello world! ";
echo "Hello world!";
?>
4)
<?php
function Message() {
echo "MY PHP FUNCTON";
}
Message();
?>
Note:Please do ask in case of any doubt,Would glad to help!!
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.