Senior PHP Programmer

  Home  Computer Programming  Senior PHP Programmer


“Sr. PHP Programmer based Frequently Asked Questions by expert members with experience as Senior PHP Programmer. These questions and answers will help you strengthen your technical skills, prepare for the new job test and quickly revise the concepts”



202 Senior PHP Programmer Questions And Answers

1⟩ Explain 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.

 171 views

3⟩ Explain 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

 153 views

5⟩ What is MVC in PHP context?

Most programmers know this, but interviewers will likely look for a deep understanding of MVC, and some explanation or examples on how/why/ when you used it.

MVC- Model, View, Controller - is simply a way of organizing your code into 3 separate layers each with there own job.

☛ Model - Usually contains data access code and all of you business logic code.

☛ View - Contains markup/design code, generally html,xml, json.

☛ Controller - Usually contains very little code, just whatever is needed to call the Model code and render the View code.

 150 views

8⟩ What is MIME?

MIME - Multi-purpose Internet Mail Extensions.

MIME types represents a standard way of classifying file types over Internet.

Web servers and browsers have a list of MIME types, which facilitates files transfer of the same type in the same way, irrespective of operating system they are working in.

A MIME type has two parts: a type and a subtype. They are separated by a slash (/).

MIME type for Microsoft Word files is application and the subtype is msword, i.e. application/msword.

 141 views

9⟩ What are the characteristics of PHP variables?

☛ Here are the most important things to know about variables in PHP.

☛ All variables in PHP are denoted with a leading dollar sign ($).

☛ The value of a variable is the value of its most recent assignment.

☛ Variables are assigned with the = operator, with the variable on the left-hand side and the expression to be evaluated on the right.

☛ Variables can, but do not need, to be declared before assignment.

☛ Variables in PHP do not have intrinsic types - a variable does not know in advance whether it will be used to store a number or a string of characters.

☛ Variables used before they are assigned have default values.

☛ PHP does a good job of automatically converting types from one to another when necessary.

☛ PHP variables are Perl-like.

 153 views

11⟩ 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

 154 views

17⟩ Explain the purpose of output buffering in PHP?

Output buffering in PHP buffers a scripts output. This buffer can be edited before returning it to the client. Without output buffering, PHP sends data to the web server as soon as it is ready. Output buffering "send" cookies at any point in the script. Cookies do not have to be necessarily sent near the start of page. Output buffers are stackable and hence sending to output is by choice.

 154 views

18⟩ Explain the different types of errors in PHP?

Notices, Warnings and Fatal errors are the types of errors in PHP

☛ Notices:

Notices represents non-critical errors, i.e. accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all but whenever required, you can change this default behavior.

☛ Warnings:

Warnings are more serious errors but they do not result in script termination. i.e calling include() a file which does not exist. By default, these errors are displayed to the user.

☛ Fatal errors:

Fatal errors are critical errors i.e. calling a non-existent function or class. These errors cause the immediate termination of the script.

 149 views

20⟩ How can we get the IP address of the client?

This question might show an interview how playful and creative the candidate is because there are many options. $_SERVER["REMOTE_ADDR"]; is the easiest solution, but you can write x line scripts for this question.

 152 views