Category: Php

45 articles

How to compare two strings in PHP

strcmp() function is used to compare two strings in php. This function is case-sensitive and binary-safe. If we need case-insensitive…

How to append a string in PHP

There’s no exact function to append a string in PHP. But PHP concatenation assignment operator (.=) is used to append a string with another string. There are…

How to prepend a string in PHP

There’s no exact function to prepend a string in PHP. But PHP concatenation operator (.) is used to returns the…

How to write comments in PHP

Comments are generally written in the block of PHP code to describe the functionality of the code. It will help…