Introduction PHP for Beginner

PHP Introduction

Php is a Server Side Scripting language. This is Open Source Language. We can create dynamic and interactive Web pages using it. 

Created in 1994 by Rasmus Lerdorf So don't waste time, let's start it.

Syntax

<?php
// write code
?>


Example -


<?php
echo "welcome to Short Tutorials"; // we can print data using echo
?>   

  
PHP ?
  1. Stands for "PHP: Hypertext Preprocessor".
  2. It is a widely-used, open-source scripting language.
  3. It scripts are executed on the server.
  4. It is free to download and use.

Things  to know for Starting PHP

  1.    HTML 
  2.    CSS
  3.    JavaScript

I would recommend you first read about above subjects first.


  1-  HTML - 
Hypertext markup language, this is a necessary language to develop any sites or learn any language, without this you can not render your data in a browser. so you need to know basic things about HTML. If you are a beginner so do not worry about it you can easily learn HTML it's so simple there are some tags.  below is an example of tags which is necessary for HTML.

Syntax-  

   <html>
   <head>
   <title>Type your title</title>
   </head>
   <body>
        <h1>Hello Folks </h1>
  </body>
   </html>
     
For more information about HTML, you can search on google.

2 - CSS
   Cascading Style Sheets, this is used for designing like as we are nothing without water because without CSS  UI is not looks good, using CSS we can design the site according to ownself. we can create colourful sites and user-friendly where the user would like to come many time. because we go to that place which is beautiful. there is some class and id with the help of them we can put CSS. we add class and id in the HTML tag with attribute class and id. below is the example. 

Syntax-

 <style>


 .test_class{

    text-color :green;

 } 


 <p class='test_class' >Hello I am green</p> 


 #test_id{

    text-color :red;

 }

    

 <p id='test_id' >Hello I am red</p> 


 </style> 

3 - JavaScript -
 
JavaScript is a client-side Langauge. Basically, this is used for the client-side like when the user does some things in the browser like clicking the button, form submits, show hides the content and can do lot's of things with the help of JavaScript. we can set and get the cookie in JavaScript which is very useful for us because if a user comes to your site so he does not want to do login again and again. so we use cookies for that, and we can also set and get the LocalStorage in JavaScript with the help of that we can store information. I created a Notes Book Tool using JavaScript. where you can write your notes or write your information like a Note Book because we can not store data in mind. you can delete, edit and set Favourite your notes and update also.
If you want to learn more click here

Syntax

<script>

  documnet.getElementById('idName');  // get the id 
  documnet.getElementsByClassName('className'); // get the Name
// write here your code 

</script>

 

These are the things PHP can do
  1. Generate dynamic page content.
  2. Create, open, read, write, delete, and close files on the server.
  3. Collect form data.
  4. Send and receive cookies.
  5. Add, delete, modify data in your database.
  6. PHP can be used to control user access.
  7. Encrypt data.

Test Yourself With Exercises -

There is a missing part of the code below, fill it and give the answer in the comment section.

 ..... You are seeing Short Tutorials


Yeah! You have learned ЁЯШК

I hope you understood this and like this article. if you like it so, please give feedback in the comment section.

If any mistakes I made here, so please let me know and improve me.
If you have any query, feel free to ask me  ЁЯШК 

Post a Comment

Please do not enter any spam link in the comment section.

Previous Post Next Post