answersLogoWhite

0

AllQ&AStudy Guides
Best answer

Yep. We do it all the time. One way is to simply tell PHP that you want the tags echoed. Like so:

<?php

echo('<b>Hi</b> Nice to meet you!');

?>

Sometimes you want instead to simply use the PHP in parts of a page and leave the rest. You can do this, too.

<body>

<div class="login">

<?php

if($user->loggedIn()){

?>

<b>Hi!</b>

<?php

}else{

?>

<!-- HTML FORM HERE -->

<?php

}

?>

</div>

</body>

This answer is:
Related answers

Yep. We do it all the time. One way is to simply tell PHP that you want the tags echoed. Like so:

<?php

echo('<b>Hi</b> Nice to meet you!');

?>

Sometimes you want instead to simply use the PHP in parts of a page and leave the rest. You can do this, too.

<body>

<div class="login">

<?php

if($user->loggedIn()){

?>

<b>Hi!</b>

<?php

}else{

?>

<!-- HTML FORM HERE -->

<?php

}

?>

</div>

</body>

View page

May be this example will help. Please focus on where ob_implicit_flush(true) and ob_end_flush(); are placed in your code.

Version 1:--------------------------------

<?PHP

ob_implicit_flush(true);

ob_end_flush();

?>

e

<div>a<div>a</div>

<?PHP sleep(1); ?>

<div>b</div>

<?PHP sleep(1); ?>

c</div>

Version 2:------------------------------

<?PHP

ob_implicit_flush(true);

ob_end_flush();

?>

e<div>a<div>a</div></div>

<?PHP sleep(1); ?>

<div>b</div>

<?PHP sleep(1); ?>

c</div>

Version 3:------------------------------

<?PHP ob_implicit_flush(true);

ob_end_flush();

?>

e<div>a<div>a</div><!--</div>-->

<?PHP sleep(1); ?>

<div>b</div>

<?PHP sleep(1); ?>

c</div>

?>

View page

By using a third temporary variable.

$tmp = $a;

$a = $b;

$b = $tmp;

View page

Answer: Php 25

10% of Php 250

= 10% * Php 250

= 0.10 * Php 250

= Php 25

View page

PHP is a Server-side HTML embedded scripting language. It means you can embed you PHP Code in HTML template.When ever Server finds <?php ?> , it always process the code and generate the HTML output.

Example:How "Hello World" get displayed on browser.

Consider "hello.php" contain <?php echo '<b>Hello World</b>'; ?> . "hello.php" is placed in your server root directory.

1. Client make a request to file. http://localhost/hello.php. Please notice local host may be replaced with your server URL like http://www.myworld.com/hello.php

2. Server receives the request and process "hello.php" . Hence , <b> Hello World</b> HTML output is generated.

3.Server return the output to client.

4.Client [Browser] receive and display the output Hence when we view source we never able to get the PHP Code.

View page
Featured study guide

Annyeonghaseyo

Kon’nichwa

Nǐ hǎo

Zàijiàn

➡️
See all cards
4.33
6 Reviews
Search results