Functions

Recently I was working with some PHP project and I had to fetch some text from database but I did not want to show all the paragraph. Instead I wanted to display just some part of it and give the reader facility to have a link or read more. For example: If the original text […]

{ 0 comments }

function_exists — Return TRUE if the given function has been defined. To check that whether a function is defined or exists or not use function_exists. Checks the list of defined functions, both built-in (internal) and user-defined, for function_name. Returns TRUE on success or FALSE on failure.

{ 0 comments }

PHP – Implode

by Hiroshi on June 23, 2008

in Implode, PHP Functions

The PHP function implode operates on an array and is known as the “undo” function of explode. If you have used explode to break up a string into pieces or parts or just have an array of stuff you can use implode to put them all into one string.

{ 0 comments }

PHP – Explode

by Hiroshi on June 23, 2008

in Explode, PHP Functions

The PHP function explode lets you take a string and blow it up into smaller pieces. For example, if you had a sentence you could ask explode to use the sentence’s spaces ” ” as dynamite and it would blow up the sentence into separate words, which would be stored in an array. The sentence […]

{ 0 comments }

PHP Functions

by Hiroshi on June 21, 2008

in PHP Basics, PHP Functions

A function is just a name we give to a block of code that can be executed whenever we need it. This might not seem like that big of an idea, but believe me, when you understand and use functions you will be able to save a ton of time and write code that is […]

{ 0 comments }