Print Statement |
This is a tutorial about print statement. Print statement is not function. In php the two basic constructs to get output are echo which we learn in previous tutorial and print. Print language is constructs in php. In echo we are echoing out users data to screen. Now print do the same work which echo do. Its also printout data on users browser.
Code for Print Statement (screenshot1):-
Code For Print Statement |
<?php
print '<strong>Hello!</strong>';
?>
output (screenshot2) :-
Print Statement |
In this example you will see echo and print does same work.Butprint is older method to output string will echo is works faster for output string of user.echo is tradition way for outputting data into browser.print is slower to use then echo.Print had more characters to write then echo.so in-short its lot better to use echo. The main reason for it its more quicker using less system resources.
No comments:
Post a Comment
Thanks For Comment Will get you Soon..