Monday, October 21, 2019
PHP Hello, World! Basic Print Script
PHP Hello, World! Basic Print Script Every programming language has it- the basic Hello, World! script.à PHP is no exception. It is a simple script that onlyà displays the words Hello, World!à The phrase has become aà tradition for new programmers who are writing their first program. Its first known usage was in B.W. Kernighans 1972 A Tutorial Introduction to the Language B, and it was popularized in his The C Programming Language.à From this beginning, it grew into a tradition in the programming world. So, how do you write this most basic of computer programs in PHP? The two simplest ways are usingà print andà echo, two similar statementsà that are more or less the same. Both are used to output data to the screen. Echo is slightly faster than print. Print has a return value of 1, so it can be used in expressions, while echo has no return value. Both statements can contain HTML markup. Echo can take multiple parameters; print takes one argument. For the purposes of this example, they are equal. ?php Print Hello, World!;php Echo Hello, World!;? In each of these two examples, the ?php indicates the start of a PHP tag and the ? indicates an exit from PHP. These entrance and exit tags identify the code as PHP, and they are used on all PHP coding.à PHP isà server-side software that is used to enhance the features of a web page. It works seamlessly with HTML to add features to a website that HTML alone cant deliver, such as surveys, login screens, forums, and shopping carts. However, it leans on HTML for their appearance on the page. PHP is open-source software, free on the web, easy to learn, and powerful. Whether you already have a website and are familiar with HTML or you are just entering web design and development, it is time to learn more about beginning PHP programming.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.