PHP Glossary

What is the minimum size of the file that can be uploaded using PHP and how can we change this:

Be default Maximum size is 2MB and we can change the following set up at php.ini file. Set upload_max_filesize=2M

How can we increase the execution time of a PHP script?

By changing the following setup at php.ini file


Note: maximum execution time of each script, in seconds

How can we get the browser properties using PHP?

By using: $_SERVER[‘HTTP_USER_AGENT’] variable

How can we get the size of an image using PHP image functions?

getimagesize() function

How can we get the type of an image using PHP image functions?

exif_imagetype() function

How can we get the width and height of an image using PHP image functions?

imagesx() function

imagesy() function

What is the type of errors in PHP

Notices: These are trivial and non-critical errors that PHP encounters while executing a script. For ex:, accessing a variable that has not yet been defined. By default such errors are not displayed to the user at all

Warning: These are more serious errors. For ex: attempting to include() a file which doesn’t exist

Fatal Errors:  These are critical errors. For ex: instantiating an object of a non existing class, or calling a non-existent function. These errors cause the immediate termination of the script and PHP’s default behavior is to display them to the user.

What are the reasons for selecting LAMP (Linux, Apache, MySQl, PHP) instead of combination of other software’s

All of those are open source resource Security of LINUX is very very more than windows. Apache is better server than IIS both in functionality and security. MySQL is world most popular open source database. PHP is faster than ASP or any other scripting language.

What is the difference between public, private, protected, static, transient, final and volatile?

Public: Public declared items can be accessed everywhere

Protected: Protected limits access to inherited and parent classes

Private: Private limits visibility only to the class that defines the item

Static: A Static variable exists only in a local function scope, but it doesn’t lose its value when program execution leaves this scope

How can we destroy the cookie?

Set the cookie in past

What is difference between char and varchar data types?

Set char to occupy n bytes and it will take n bytes even if u r storing a value of n-m-bytes

Set varchar to occupy n bytes and it will take only the required space and will not use the n bytes

For ex: Name char (10) will waste 3 bytes if we store ‘kaushal’, if each char take a byte

For ex: Name varchar (10) will just use 7 bytes if we store ‘kaushal’, if each char take a byte. rest 3 bytes will be free.

Related Post


Kaushal Arwal has written 6 articles