Skip to main content

if condition with example in php

 what is if condition in php?

write a if condition example in php?


if condition in php

php me if statement  ka use aap kisi bhi   condition ko check karne ke liye kar sakte h. iske   liye  aap pahle  variable  ko declare karte hai. eske baad me aap  if  condition me aap pahle condition ko dete h . baad me statement. agar aapki condition true hoti hai to if block me diya gaya statement exicute ho jayega otherwise condition false hone per controller bahar ho jayega.php me program write kare ke liye php scripting opening tag and closing tag ka use karte hai. opening and closing  tag ke middile me apne program ko write karte hai.


   Syntax:

 if(condition){

statement;

}

Example: 

 <?php

$a =10;

 if ($a > 5) {

echo "condition is true";

}

?>

output:

condition is true 

 

 

 

  

 

 

 

 

Comments

Popular posts from this blog

How to create a table in html

  Hello dosto 🙏🙏 Aaj ham dekhenge ki kaise html Me table create karte hai . Create A Table In Html: Html me table create karne ke liye  for example ham student name ki table banayenge:- <!DOCTYPE html> <html> <head> <Title>Creating a table</title> </head> <body> <table border="1" cellspacing="0"> <tr> <tr>student table</tr> <th>name</th> <th>class</th> <th>address</th> </tr> <tr> <td>ram</td> <td>bca</td> <td>rampur</td> </tr> </tr> </table> </body> </Html> Coding karne ke baad apka Student name ki table ban Jati hai If this information is helpful, To aisi hi coding sekhna chahte to neeche comments kare Thanks 

Introduction of php and it's features

 what is php ? what is features of php language? Introduction of PHP  PHP is a server site scripting language. which we use to create a dynamic  content, website  and web application.  PHP language is develop by Rasmus Lerdorf in 1994. In this time, PHP is a most popular scripting language. Most popular website as facebook and yahoo developed by php language. Features of PHP Php is a most popular and secondary used for world wide scripting language. there are many features of php language:- simple and easy to learn open source error reporting faster case sensitive loosely type language independent plateform Simple And easy to learn PHP is a very simple to use read and write.PHP language understandable and user-friendly. user and developer easily identify PHP code. Interpreted language PHP is an interpreted language, which means there is no need for compilation. Interpreters run through a program line by line and execute the code. PHP language no need of compiler...

HTML

HTML  HTML (HyperText Markup Language) is a standard markup language used to creat web pages. It is the foundation of most websites and is used to structure and format the content of a web page, including text, images, and other media. HTML is a very simple language that consists of a set of tags enclosed in angle brackets. These tags tell the web browser how to format and display the content of a web page. Here is a simple example of an HTML document: <html>    <head>       <title>My blog Page</title>    </head>    <body>       <h1>Welcome to my blog</h1>    </body> </html> In this example, the html element is the root element of the HTML document and it contains the 'head' and 'body' elements. The 'head' element contains information about the document, such as the title, and the 'body' element contains the content of the document.