Php String Snippets


26 May, 2012   

Allows to perform PHP redirection (must be placed before any browser output).

14 February, 2011   

You'll need a of copy Simple Pie for the include right at the top here.

19 April, 2016   

A simple method that generates a MD5 hash from a given string. It should be compatible with PHP's md5() function (just lowercase the string).

Tries to make out of the given string a xhtml-compatible string, that means that the return-string could be wrapped within a xml.

PHP code to create a human readable string that will look more close to dictionary words, useful for captchas.

04 October, 2012   

Code example for parsing XML in easy way using PHP

19 April, 2015   

Merges two strings in a way that a pattern like ABABAB will be the result.

21 May, 2012   

PHP example for connecting to MySQL

07 April, 2013   

Search a body of text for the most common words

23 October, 2012   

MySQL code example for sorting data in a GRID

29 July, 2015   

Apache code example shows how to remove .php from URL

13 February, 2013   

PHP Code example for ASCII CAPTCHA

Encodes the given data with MIME base64. Base64-encoded data takes about 33% more space than the original data.

PHP code example for redirecting from old URL to new URL

You can use a url shortener with Twitter such as tinyurl.com

04 February, 2013   

This removes every instance of a space in the given string returning the new string as a string for Visual Basic

16 March, 2014   

How to create mysql table using php. The php script as follows as:

04 February, 2012   

PHP function example that writes a name when it is called.

This allows you to do String.random_alphanumeric(num) to get a random string that is num characters long. Useful for generating random identifier keys.

PHP code for Base64 Encode and Decode