Question 1 :
What are encryption functions in PHP?
Question 2 :
What is the difference between htmlentities() and htmlspecialchars()?
htmlspecialchars() - Convert some special characters to HTML entities (Only the most widely used)
htmlentities() - Convert ALL special characters to HTML entities
Question 3 :
What is the functionality of the function htmlentities?
htmlentities() - Convert all applicable characters to HTML entities
This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities.
Question 4 :
How can we get the properties (size, type, width, height) of an image using php image functions?
To know the image size use getimagesize() function
To know the image width use imagesx() function
To know the image height use imagesy() function
Question 5 :
How can we increase the execution time of a php script?
By the use of void set_time_limit(int seconds)
Set the number of seconds a script is allowed to run. If this is reached, the script returns a fatal error. The default limit is 30 seconds or, if it exists, the max_execution_time value defined in the php.ini. If seconds is set to zero, no time limit is imposed.
When called, set_time_limit() restarts the timeout counter from zero. In other words, if the timeout is the default 30 seconds, and 25 seconds into script execution a call such as set_time_limit(20) is made, the script will run for a total of 45 seconds before timing out.
Question 6 :
HOW CAN WE TAKE A BACKUP OF A MYSQL TABLE AND HOW CAN WE RESTORE IT?
Create a full backup of your database: shell> mysqldump tab=/path/to/some/dir opt db_name
Or: shell> mysqlhotcopy db_name /path/to/some/dir
The full backup file is just a set of SQL statements, so restoring it is very easy:
shell> mysql "."Executed";
To backup: BACKUP TABLE tbl_name TO /path/to/backup/directory
' To restore: RESTORE TABLE tbl_name FROM /path/to/backup/directory
mysqldump: Dumping Table Structure and Data
Utility to dump a database or a collection of database for backup or for transferring the data to another SQL server (not necessarily a MySQL server). The dump will contain SQL statements to create the table and/or populate the table.
Don't write table creation information (the CREATE TABLE statement).
Don't write any row information for the table. This is very useful if you just want to get a dump of the structure for a table!
Question 7 :
How to set cookies?
variable - name of the cookie variable
value - value of the cookie variable
time - expiry time
Test - cookie variable name
$i - value of the variable 'Test'
time()+3600 - denotes that the cookie will expire after an one hour
Question 8 :
How to reset/destroy a cookie ?
Reset a cookie by specifying expire time in the past:
Example: setcookie('Test',$i,time()-3600); // already expired time
Reset a cookie by specifying its name only
Question 9 :
What types of images that PHP supports ?
Using imagetypes() function to find out what types of images are supported in your PHP engine.
imagetypes() - Returns the image types supported.
This function returns a bit-field corresponding to the image formats supported by the version of GD linked into PHP. The following bits are returned, IMG_GIF | IMG_JPG | IMG_PNG | IMG_WBMP | IMG_XPM.
Question 10 :
var myValue =9.8; if(parseInt(myValue)== myValue) alert('Integer'); else alert('Not an integer');
Question 11 :
Tools used for drawing ER diagrams.
Question 12 :
bool is_numeric( mixed var)
Returns TRUE if var is a number or a numeric string, FALSE otherwise.
Definition and Usage
The isNaN() function is used to check if a value is not a number.
number Required. The value to be tested
Question 13 :
How can we submit from without a submit button?
Question 14 :
How many ways can we get the value of current session id?
session_id() returns the session id for the current session.
Question 15 :
How can we destroy the cookie?
Set the cookie with a past expiration time.