Php String Snippets


This is a very common PHP question of HOW TO remove last character from string in PHP. Find below some ways how to delete last character from string in PHP.

04 October, 2012   

Turn a string into a readable url

Example shown here how to convert a PHP array into a string

This basic snippet will create a random authentication code, or just a random string.

13 April, 2011   

Reading a file to a string couldn't be easier than using the file_get_contents() function. Simple pass the name of the file (with path) and optional parameters

This code will break a string of words up along the spaces and do a mySQL search for each of the words in the string.

This code will break a string of words up along the spaces and do a mySQL search for each of the words in the string.

30 March, 2011   

Need to unzip a file? this function can do that for you. It is reccomended that the functions.php file and the file that exicutes the unzip function are NOT in the same directory as the zip files. unzip ( string $zipfile , string $newLocation ) zipfile gets the name of the current zip file. newLocation is where you want to store all the...

02 June, 2011   

This is your most basic version of an image CAPTCHA.

05 August, 2014   

PHP code example to highlight words in a string.

Define allowed characters in $s and length for the string in $l

06 June, 2012   

This function highlight_string() outputs or returns a syntax highlighted version of the given PHP code using the colors defined in the built-in syntax highlighter for PHP.

16 March, 2011   

This checks to see if two strings match each other.

06 May, 2013   

Code example for Month Day Year Dropdown

15 April, 2012   

PHP code example for an image CAPTCHA.

27 October, 2011   

An example to include another PHP file into a PHP script

11 October, 2011   

In the same way you often need to format data being sent from Flash, you sometimes need to format data being received. This function takes a string and removes all spaces from it. Here we use the split method of the String class to split the string into an Array and then call the join method of the Array class to convert it back to a string....

12 March, 2017   

PHP code snippet for Automatic Mailto Links

29 October, 2011   

Here shown an example how to Compress CSS with PHP

27 May, 2013   

Example shows here how to compress CSS with PHP