Php String Snippets

13 March, 2011   

This code convert String to Hexadecimal

06 February, 2013   

Delphi code for String to Hexadecimal

Convert a string of text and ad hyperlinks to all the URLs. We loop through each URL and add a hyperlink

07 December, 2011   

Php code to guessing a number using in html page

27 May, 2015   

A very common task is converting a number of bytes into something for human digestion.

11 July, 2011   

To do a Hello world proved to be quite simple, so lets take it a bit further and write a function which prints the hello world text.

07 April, 2013   

A simple example code for user login with a login form and database query

11 August, 2012   

MySQL code to find and replace string

This function takes in two strings (value,key) and uses XOR encryption to encrypt (and decrypt) the value using the key. it returns the encrypted value as a C++ string. by John Shao

04 March, 2012   

The for loop is used when you know in advance how many times the script should run.

16 November, 2014   

Useful php code to see if the current file is being included or run directly.

08 June, 2013   

Checks if the given encoding supports all the characters in the given string

Assigns the contents of a "url" to the string variable "result".

14 February, 2012   

MySQL code to connect to db. Don't forget to change the parameters.

14 August, 2012   

PHP code to validate email

This example code showing how to use PHP Functions to clean User Input

To create the formatter paste this code into a new file and name it sfWidgetFormSchemaFormatterDefList.class.php. I saved it in /lib but it also makes sense to put it in /lib/form, depending on your personal preference.

Have you ever wanted to know how much memory one of your PHP scripts uses when it runs? You might want this information if your script has a memory leak or takes a long time to execute. If that's the case then there's a great built-in function called memory_get_usage, which will display the exact amount of memory being used by your script. This...

If a string is contained in another string and you need to search for it, this is a very clever way to do it:

A project that needs to clear all non-alphabetical figures in a String and separating it every 60 characters(new line after 60 characters)..