How we can retrieve the data in the result set of MySQL using PHP?
What is the use of explode() function ?
Syntax : array explode ( string $delimiter , string $string [, int $limit ] );
This function breaks a string into an array. Each of the array elements is a substring of string formed by splitting it on boundaries formed by the string delimiter.
Write down the code for save an uploaded file in php.
if ($_FILES["file"]["error"] == 0)
"upload/" . $_FILES["file"]["name"]);
echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
How to create a text file in php?
$filename = "/home/user/guest/newfile.txt";
$file = fopen( $filename, "w" );
if( $file == false )
echo ( "Error in opening new file" ); exit();
fwrite( $file, "This is a simple test\n" );
fclose( $file );
What are the encryption techniques in PHP
MD5 PHP implements the MD5 hash algorithm using the md5 function,
eg : $encrypted_text = md5 ($msg);
mcrypt_encrypt :- string mcrypt_encrypt ( string $cipher , string $key , string $data , string $mode [, string $iv ] );
Encrypts plaintext with given parameters
What are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()?
What are the different types of errors in PHP ?
Here are three basic types of runtime errors in PHP:
What are the different errors in PHP?
In PHP, there are three types of runtime errors, they are:
These are important errors. Example: When we try to include () file which is not available. These errors are showed to the user by default but they will not result in ending the script.
These errors are non-critical and trivial errors that come across while executing the script in PHP. Example: trying to gain access the variable which is not defined. These errors are not showed to the users by default even if the default behavior is changed.
These are critical errors. Example: instantiating an object of a class which does not exist or a non-existent function is called. These errors results in termination of the script immediately and default behavior of PHP is shown to them when they take place. Twelve different error types are used to represent these variations internally.