Junior PHP Developer

  Home  Web Development  Junior PHP Developer


“Junior PHP Developer related Frequently Asked Questions in various Junior PHP Developer job interviews by interviewer. The set of questions here ensures that you offer a perfect answer posed to you. So get preparation for your new job hunting”



161 Junior PHP Developer Questions And Answers

1⟩ Do you know what is PHP?

PHP is a server side scripting language commonly used for web applications. PHP has many frameworks and cms for creating websites. Even a non technical person can cretae sites using its CMS. WordPress, osCommerce are the famus CMS of php. It is also an object oriented programming language like java, C-sharp etc. It is very eazy for learning

 186 views

3⟩ Explain what is the difference between Session and Cookie?

The main difference between sessions and cookies is that sessions are stored on the server, and cookies are stored on the user's computers in the text file format. Cookies can not hold multiple variables, But Session can hold multiple variables. We can set expiry for a cookie, The session only remains active as long as the browser is open. Users do not have access to the data you stored in Session, Since it is stored in the server.Session is mainly used for login/logout purpose while cookies using for user activity tracking

 140 views

6⟩ Do you know what is the use of rand() in php?

It is used to generate random numbers. If called without the arguments it returns a pseudo-random integer between 0 and getrandmax(). If you want a random number between 6 and 12 (inclusive), for example, use rand(6, 12). This function does not generate cryptographically safe values, and should not be used for cryptographic uses. If you want a cryptographically secure value, consider using openssl_random_pseudo_bytes() instead.

 141 views

8⟩ Explain me what are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()?

☛ Mysql_fetch_array Fetch a result row as an associative array, a numeric array, or both.

☛ mysql_fetch_object ( resource result ) Returns an object with properties that correspond to the fetched row and moves the internal data pointer ahead. Returns an object with properties that correspond to the fetched row, or FALSE if there are no more rows

☛ mysql_fetch_row() fetches one row of data from the result associated with the specified result identifier. The row is returned as an array. Each result column is stored in an array offset, starting at offset 0.

 170 views

9⟩ Tell me what is PEAR?

PEAR is a framework and distribution system for reusable PHP components. The project seeks to provide a structured library of code, maintain a system for distributing code and for managing code packages, and promote a standard coding style. PEAR is broken into three classes: PEAR Core Components, PEAR Packages, and PECL Packages. The Core Components include the base classes of PEAR and PEAR_Error, along with database, HTTP, logging, and e-mailing functions. The PEAR Packages include functionality providing for authentication, networking, and file system features, as well as tools for working with XML and HTML templates.

 138 views

11⟩ Tell me how comparison of objects is done in PHP5?

We use the operator ‘==’ to test is two object are instanced from the same class and have same attributes and equal values. We can test if two object are refering to the same instance of the same class by the use of the identity operator ‘===’.

 135 views

19⟩ Explain what are the different errors in PHP?

In PHP, there are three types of runtime errors, they are:

☛ Warnings:

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.

☛ Notices:

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.

☛ Fatal errors:

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.

 142 views

20⟩ Tell me 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

 192 views