41⟩ Explain what is the difference between ExceptiongetMessage and ExceptiongetLine?
Exception::getMessage lets us getting the Exception message and Exception::getLine lets us getting the line in which the exception occurred.
“Internee PHP Developer based Frequently Asked Questions in various Internee PHP Developer job interviews by interviewer. These professional questions are here to ensures that you offer a perfect answers posed to you. So get preparation for your new job hunting”
Exception::getMessage lets us getting the Exception message and Exception::getLine lets us getting the line in which the exception occurred.
The function eregi_replace() is identical to the function ereg_replace() except that it ignores case distinction when matching alphabetic characters.
☛ $result = mysql_query($sql, $db_link);
☛ $num_rows = mysql_num_rows($result);
☛ echo "$num_rows rows found";
javascript is a client side scripting language, so javascript can make popups and other things happens on someone’s PC. While PHP is server side scripting language so it does every stuff with the server.
Register the variable into the session
Pass the variable as a cookie
Pass the variable as part of the URL
Just like in C++, put an ampersand in front of it, like $a = &$b;
PHP syntax resembles Perl and C
PHP 5 presents many additional OOP (Object Oriented Programming) features.
$_ENV is an associative array of variables sent to the current PHP script via the environment method.
parent::constructor($value)
$_FILES[‘userfile’][‘error’] contains the error code associated with the uploaded file.
__sleep returns the array of all the variables than need to be saved, while __wakeup retrieves them.
We can change the maximum size of files to be uploaded by changing upload_max_filesize in php.ini.
A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests. Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete functional transaction for the same visitor.
Both include and require used to include a file but when included file not found
Include send Warning where as Require send Fatal Error
The use of the set_time_limit(int seconds) enables us to extend the execution time of a php script. The default limit is 30 seconds.
$GLOBALS is associative array including references to all variables which are currently defined in the global scope of the script.
Just use the PHP command line interface (CLI) and specify the file name of the script to be executed as follows:
php script.php
strstr() returns part of a given string from the first occurrence of a given substring to the end of the string.
For example:strstr("user@example.com","@") will return "@example.com".
stristr() is idential to strstr() except that it is case insensitive.
PEAR means “PHP Extension and Application Repository”. it extends PHP and provides a higher level of programming for web developers.