PHP is the author, HTML is the publisher.
Front End in essence simply means the part which Users can see. Example include this live site.
while Backend implies that part of the system whereby only the Admin and those with access level are able to see. Examples include - Database of Users.
Now Lets go Practical
HTML means Hypertext Markup Language and, along with CSS and Javascript,it is called the front-end.
PHP means Hypertext Preprocessor and it is a server-side scripting language. This is the back-end.
Front End in essence simply means the part which Users can see. Example include this live site.
while Backend implies that part of the system whereby only the Admin and those with access level are able to see. Examples include - Database of Users.
HTML
can run from your desktop too. If you’ve got a file index.html sitting
on your desktop, you can just double click on it and it’ll open up and
render the text on your browser. PHP, on the other hand, requires a Web
Server to run on.
PHP is
used server-side to get information from a database or something else
that needs to be done on the server. You can then use html (where all
the work is done in the user's browser) to make that data look pretty.
So, PHP’s main job is to process some data and render it in a language the browser understands (which is HTML).
If you’ve got a webpage you want to display a message on: ‘Hi There!’, here’s how you would do it in HTML:
<h1>Hi There!</h1>
And in PHP:echo ‘<h1>Hi There!h1>’;
Your HTML file will be named with the extension ‘.html’, whilst your PHP file will have the extension .php.
now,
Here’s some code I stole off Mobile Detect (a PHP library)
- // Include and instantiate the class.
- require_once 'Mobile_Detect.php';
- $detect = new Mobile_Detect;
- // Any mobile device (phones or tablets).
- if ( $detect->isMobile() ) {
- echo "You're probably on a phone! ";
- }
No comments:
We have Zero Tolerance to Spam. Chessy Comments and Comments with Links will be deleted immediately upon our review.
Post a Comment