How to append a string in PHP ?
We have given two strings and the task is to append a string str1 with another string str2 in PHP. There is no specific function to append a string in PHP. In order to do this task, we have the this operator in PHP:...
read more
Connect PHP to MySQL
What is MySQL?...
read more
How to create a PHP form that submit to self ?
Forms can be submitted to the web page itself using PHP. The main purpose of submitting forms to self is for data validation. Data validation means checking for the required data to be entered in the form fields. PHP_SELF is a variable that returns the current script being executed. You can use this variable in the action field of the form. The action field of the form instructs where to submit the form data when the user presses the submit button. Most PHP pages maintain data validation on the same page as the form itself. An advantage of doing this is in case of a change in the website structure, the data validation code for the form, and the form remain together.Code Snippet:...
read more
Ping in C
Prerequisites: ICMP | Raw Socket | Internet Checksum | DNS Ping is a necessity for debugging the Internet. Ping is a basic Internet tool that allows a user to verify that a particular IP address exists and can accept requests., with other facilities....
read more
How to change color of PNG image using CSS?
Given an image and the task is to change the image color using CSS. Use filter function to change the png image color. Filter property is mainly used to set the visual effect to the image. There are many property value exist to the filter function....
read more
How to merge two PHP objects?
Given two objects of same class and the task is to merge both objects into single object.Approach 1: Convert object into data array and merge them using array_merge() function and convert this merged array back into object of class stdClass.Note: While merging the objects using array_merge(), elements of array in argument1 are overwritten by elements of array in argument2. This may nullify the resulting elements in final object if array in argument2 has null values. Note: Functions are not copied using this approach. Only use this approach if class only contain variables.Example:...
read more
How to generate a random, unique, alphanumeric string in PHP
There are many ways to generate a random, unique, alphanumeric string in PHP which are given below:...
read more
How to remove portion of a string after a certain character in PHP?
The substr() and strpos() function is used to remove portion of string after certain character. strpos() function: This function is used to find the first occurrence position of a string inside another string. Function returns an integer value of position of first occurrence of string. Function treats upper-case and lower-case characters differently....
read more
How to change the session timeout in PHP?
In PHP, sessions are maintained to check if the user is active. When the user becomes inactive and the user forgets to logout from the web page, there is a chance of other users viewing the page causing security breach. By default, a session in PHP gets destroyed when the browser is closed. Session timeout can be customized, to make the user’s page inactive after a fixed time. Starting session: The PHP, session_start() function is used to start a session in the web page.Syntax:...
read more
PHP Full Form
The Full form of PHP is Hypertext Preprocessor and earlier it was abbreviated as Personal Home Page. It is a general-purpose programming language used to design a website or web application. It is the server-side scripting language embedded with HTML to develop Static website, Dynamic website, or Web applications. It was created by Rasmus Lerdorf in 1994. The syntax of PHP is similar to C, C++, and Java. It manages the dynamic content, database, session, cookies, etc of a dynamic website....
read more
How to extract numbers from string in PHP ?
In this article, we will extract numbers from strings using PHP. There are various built-in methods to extract numbers from strings, some of them are discussed below....
read more
Difference Between Programming, Scripting, and Markup Languages
When it comes to making a website or app coding involves basically three types of languages i.e the programming language, Scripting Language and Markup Language....
read more