PHP Password Hashing Functions API Example

PHP Password Hashing Functions API Example is today’s topic. The new hashing functions API in PHP 5.5 provides support towards bcrypt while hiding its complexity. You should be hashing the users’ passwords using the bcrypt() function, but still, a surprising number of developers uses the insecure md5() or sha1() hashes (look at the recent password … Read more

PHP Regular Expression: How to Use RegExp in PHP

Regular Expressions, commonly known as the “regex” or “RegExp,” are specially formatted text strings used to detect patterns in text. Regular expressions are one of the various robust tools available today for effective and efficient text processing and manipulations. Why use regular expressions Regular expressions simplify identifying patterns in the string data by calling the … Read more

PHP Strlen Example | strlen() Function Tutorial

PHP Strlen Example | strlen() Function Tutorial is today’s topic. The strlen() function returns a length of the string. Returns a length of the string on success, and 0 if the string is empty. It takes a string as a parameter and returns its length. The strlen() function calculates a length of a string, including … Read more

PHP strpos() Example | PHP strpos() Function Tutorial

PHP strpos() Example | PHP strpos() Function Tutorial is today’s topic. The strpos() function finds a position of the first occurrence of a substring in the string. The strpos() function finds a position of the first occurrence of the string inside another string. The strpos() function is case-sensitive.This function is binary-safe. PHP strpos() Example Being able … Read more

PHP join: How to Join Array Elements in PHP

The join() function is an inbuilt function in PHP and is used to join the array of elements that are separated by the string. PHP join() PHP join() is an inbuilt function that returns the string from the items of an array. The join() function is an alias of an implode() function. The separator parameter … Read more

PHP str_replace Example | PHP str_replace() Function

PHP str_replace() is an inbuilt string function that replaces some characters with some other characters in the string. The str_replace() is the built-in function in PHP and is used to replace all the occurrences of a search string or array of search strings by the replacement string or array of replacement strings in the given … Read more

PHP Array Search Example | array_search() Function Tutorial

PHP array_search() is an inbuilt function that searches an array for a value and returns the key. The array_search() function returns the key for value if it is found in the array. It returns FALSE or nothing if it is not found. If the value is found in the array more than once, then the first matching key … Read more

What is PHP array_diff() Function and How to Use It

PHP array_diff() is a built-in function that compares the values of two or more arrays and returns the differences. The array_diff() function compares the values of two or more arrays and returns the array that contains the entries from an array1 that are not present in an array2 or array3, etc. The array_diff() function returns … Read more

PHP array_combine: How to Combine Array Based on Key/Values

The array_combine() is used to combine two arrays and create the new array by using one array for keys and another for values. PHP array_combine() PHP array_combine() is an inbuilt function that creates an array by using the elements from one “keys” array and one “values” array.  That is all elements of one array will … Read more