What is ucfirst, ucwords, lcfirst, strtolower, strtoupper function in php?
-
zendnwar
-
July 26, 2012
-
PHP Basic
-
0 Comments
What is ucfirst, ucwords, lcfirst, strtolower, strtoupper function in php? ucfirst : Make a string’s first character uppercase <?php $var = ‘anwar hossain!’; $var = ucfirst($var); // Anwar hossain! $bar = ‘HELLO WORLD!’; $bar = ucfirst($bar); // HELLO WORLD! $bar = ucfirst(strtolower($bar)); // Hello world! ?> ucwords : Uppercase the first character of each word in a string. <?php $var …
Continue Reading
What is zend engine in PHP?
-
zendnwar
-
July 25, 2012
-
PHP Basic
-
0 Comments
What is zend engine in PHP? Zend Engine is used internally by PHP as a complier and runtime engine. PHP Scripts are loaded into memory and compiled into Zend opcodes.
Continue Reading
What is the difference between echo and print statement in PHP?
-
zendnwar
-
July 25, 2012
-
PHP Basic
-
1 Comment
What is the difference between echo and print statement in PHP? Multiple expressions can be given in echo statement, where as print cannot take multiple expressions.Echo does not have a return value, where as print returns a value indicating successful execution.Echo is faster when compared with print.
Continue Reading
Explain the difference between $var and $$var?
-
zendnwar
-
July 25, 2012
-
PHP Basic
-
0 Comments
Explain the difference between $var and $$var? $var is a variable and $$var is a variable of another variable. For example $var = “Shafin”; $you= “Anwar”; echo $var //Output:- Shafin echo $$var //output :-Anwar $$var allows the developer to change the name of the variable dynamically.
Continue Reading
What is Constructors and Destructors?
-
zendnwar
-
July 25, 2012
-
PHP Basic
-
0 Comments
What is Constructors and Destructors? CONSTRUCTOR : PHP allows developers to declare constructor methods for classes. Classes which have a constructor method call this method on each newly-created object, so it is suitable for any initialization that the object may need before it is used. DESTRUCTORS : PHP 5 introduces a destructor concept similar to that of other object-oriented languages, …
Continue Reading
What are the different types of errors in php?
-
zendnwar
-
July 24, 2012
-
PHP Basic
-
0 Comments
What are the different types of errors in php? Notices: These are trivial, non-critical errors that PHP encounters while executing a script – for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all – although, as you will see, you can change this default behaviour. Warnings: These …
Continue Reading
Explain include(), include_once, require() and require_once.
-
zendnwar
-
July 24, 2012
-
PHP Basic
-
0 Comments
Explain include(), include_once, require() and require_once: include() The include() function takes all the content in a specified file and includes it in the current file. If an error occurs, the include() function generates a warning, but the script will continue execution. include_once() File will not be included more than once. If we want to include a file once only and …
Continue Reading
What are the differences between GET and POST methods in form submitting?
-
zendnwar
-
July 24, 2012
-
PHP Basic
-
0 Comments
What are the differences between GET and POST methods in form submitting? On the server side, the main difference between GET and POST is where the submitted is stored. The $_GET array stores data submitted by the GET method. The $_POST array stores data submitted by the POST method. On the browser side, the difference is that data submitted by …
Continue Reading
What is the difference between the functions unlink and unset?
-
zendnwar
-
July 24, 2012
-
PHP Basic
-
0 Comments
unlink() deletes the given file from the file system. unset() makes a variable undefined.
Continue Reading
How can convert the time zones using PHP?
-
zendnwar
-
July 24, 2012
-
PHP Basic
-
0 Comments
date_default_timezone_set function on PHP 5.1.0 <?php // Discover what 8am in Tokyo relates to on the East Coast of the US // Set the default timezone to Tokyo time: date_default_timezone_set(‘Asia/Tokyo’); // Now generate the timestamp for that particular timezone, on Jan 1st, 2000 $stamp = mktime(8, 0, 0, 1, 1, 2000); // Now set the timezone back to US/Eastern date_default_timezone_set(‘US/Eastern’); …
Continue Reading