Technology: PHP

Create Simple Login Page with PHP and MySQL

 - 
Using login page registered users sign in to the website and manage its account. On the user successful login attempt need to define $_SESSION. This helps to detect the user is actually logged in or not when going to another web pages and it also
Read More…

What is difference between is_int() vs is_integer() vs is_numeric()?

 - 
The key difference between these two functions is that is_int() checks the type of variable, while is_numeric() checks the value of the variable. For example: $var = “12345”; The above variable is not an integer value so is_int($var) will return false. The is_numeric($var) will return true because its check
Read More…

Difference between print_r(), var_dump() and var_export()?

 - 
print_r()   Outputs a human-readable representation of any onevalue Accepts not just strings but other types including arrays and objects, formatting them to be readable Useful when debugging May return its output as a return value (instead of echoing) if the second optional argument is given
Read More…

Difference between Echo and Print?

 - 
Echo and Print both are the php statement. They are used to display the output on the screen. Both the statements are used in a different manner to get the output which we will discuss later in this article. echo echo is a statement i.e
Read More…

What is difference between == and === in PHP?

 - 
See below difference: ” == NULL would return true 0 == NULL would return true false == null would return true whereas: ” === NULL would return false 0 === NULL would return false false === NULL would return false Let me explain more using
Read More…

What is difference between Session and Cookies?

 - 
Session Session stores user data at server that is associated with a cookie information Session data stored on server Secure than cookie Session data will be destroyed when browser closed Session can store huge amount of data Session can hold multiple variables Cookies Cookie stores
Read More…

What is difference between GET and POST?

 - 
POST Secure than GET request POST data can’t be cached POST can’t expose form data to browser URL POST can transfer huge amount of data (8 MB MAX) POST can upload file POST can’t maintain browser history POST can’t be bookmark   GET Less secure
Read More…

Constant vs Static?

 - 
Constant Constant is just a constant it means we can’t change its value after declaring CONSTANT can’t have visibility (public/private/protected) CONSTANT is recognized as public by default Static Static value can be changed after declaring Static variable can be accessible with class object Static can
Read More…

Single Quotes vs Double Quotes

 - 
There are 3 syntax used to declare strings, in PHP <= 5.2: single quoted double quoted heredoc   With single quotes : Variables and escape sequences for special characters will not be expanded. For instance : echo ‘Variables do not $expand $either’; Will output :    Variables
Read More…

htmlspecialchars() VS htmlentities()

 - 
Both coverts special characters to HTML entities. Both are used to prevent XSS attacks during user data validation and output escaping. htmlspecialchars($string, ENT_QUOTES, ‘UTF-8’) It converts only 5 special characters to HTML entities. ‘’ Single quote becomes &quot “” Double quote becomes &#039 < Less
Read More…