if Statement Uses else

if Statement uses else When working with the if statement, you will often want to define an alternative block of code that should be executed if the expression you are testing evaluates to false. You can do this by adding else to the if statement followed by a further block of code: if ( expression ) { // code to …

Continue Reading

if Statement in php

if Statement in php An if statement is a way of controlling the execution of a statement that follows it (that is, a single statement or a block of code inside braces). The if statement evaluates an expression between parentheses. If this expression results in a true value, the statement is executed. Otherwise, the statement is skipped entirely. This enables …

Continue Reading

PHP Date() Function

date-> Format a local time/date. date(format,timestamp) format            : Required. Specifies the format of the timestamp timestamp     : Optional. Specifies a timestamp. Default is the current date and time The following characters are recognized in the format parameter string format character Description Example returned values Day — — d Day of the month, 2 digits …

Continue Reading

What is str_split?

str_split : Convert a string to an array <?php $str = “Anwar Hossain”; $arr1 = str_split($str); $arr2 = str_split($str, 3); print_r($arr1); print_r($arr2); ?> OUTPUT: Array ( 0 => A 1 => n 2 => w 3 => a 4 => r 5 => 6 => H 7 => o 8 => s 9 => s 10 => a 11 => …

Continue Reading

What is substr() in php?

substr()  This function returns a part of a string. substr(string,start,length) string :   The input string. Must be one character or longer. start :     The start is how many characters in to skip before starting. Setting this to 3 would skip the first three and start returning at the forth character. Setting this to a negative number  will start counting backwards …

Continue Reading

What is the difference between Split and Explode?

split()-used for JavaScript for processing the string and the explode()-used to convert the String to Array, implode()-used for convert the array to String. split() can work using regular expressions.but Explode use only single value to explode string into Array Here the Example <?php $date = “04/30/1973″; list($month, $day, $year) = split(‘/.-’, $date); ?> ……………………………………………………………………… <?php $x=”PHP is a ServerSide Scripting …

Continue Reading

What’s the difference between htmlentities() and htmlspecialchars() in php?

htmlspecialchars:  Convert special characters to HTML entities. htmlentities: Convert all applicable characters to HTML entities. htmlspecialchars only takes care of <, >, single quote ‘, double quote ” and ampersand. htmlentities translates all occurrences of character sequences that have different meaning in HTML. <?php $str = “A ‘quote’ is <b>bold</b>”; echo htmlentities($str); echo htmlentities($str, ENT_QUOTES); ?>   OUTPUT A ‘quote’ …

Continue Reading

What is PHP?

What is PHP? Devised by Rasmus Lerdorf in 1994,PHP is a programming language that allows building dynamic, interactive websites. PHP stands for PHP: Hypertext Preprocessor.PHP is a server-side scripting language.PHP scripts are executed on the server.PHP supports many databases like MySQL, Informix,  Oracle, Sybase, Solid, PostgreSQL, Generic ODBC. PHP is open source software. PHP is free to download and use. …

Continue Reading

PHP Basic

I am Anwar Hossain, Expert web Programmer. Working More than 4 years on php. Also working several CMS and Framework like CMS(Joomla1.5 to 2.25,Wordpress And Drupal), Zend framework1.11, Cakephp1.3 version. Also working in Design pattern like html/xhtml,css2/css3,Photoshop and flash animation. I am also SEO specialist.And SEO trainer. I will try to explain Basic php related description and example. Stay close …

Continue Reading