Posts

How to get the current URL in PHP?

< 1 min readTo get the current URL in PHP, you can use the $_SERVER[‘REQUEST_URI’] variable. This variable contains the path of the current request, including the query string (if any). For example: You can also use the $_SERVER[‘PHP_SELF’] variable to get the path of the current script, or the $_SERVER[‘SCRIPT_NAME’] variable to get the path of the…

Read More

How to convert a string to lowercase in PHP?

< 1 min readTo convert a string to lowercase in PHP, you can use the strtolower() function. This function converts all the characters of a string to lowercase, and returns the modified string. For example: You can also use the mb_strtolower() function to convert a multibyte string to lowercase. This function requires the mbstring extension to be enabled…

Read More

How to convert a string to uppercase in PHP?

< 1 min readTo convert a string to uppercase in PHP, you can use the strtoupper() function. This function converts all the characters of a string to uppercase, and returns the modified string. For example: You can also use the mb_strtoupper() function to convert a multibyte string to uppercase. This function requires the mbstring extension to be enabled…

Read More