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

182⟩ What are the common usage of PHP?

Common uses of PHP −

☛ PHP performs system functions, i.e. from files on a system it can create, open, read, write, and close them.

☛ PHP can handle forms, i.e. gather data from files, save data to a file, thru email you can send data, return data to the user.

☛ You add, delete, modify elements within your database thru PHP.

☛ Access cookies variables and set cookies.

☛ Using PHP, you can restrict users to access some pages of your website.

☛ It can encrypt data.

 198 views

184⟩ How will you concatenate two strings in PHP?

To concatenate two string variables together, use the dot (.) operator −

<?php

$string1="Global Guideline";

$string2="Interviews";

echo $string1 . " " . $string2;

?>

This will produce following result:

Global Guideline Interviews

 198 views

186⟩ How will you generate random numbers using PHP?

The PHP rand() function is used to generate a random number. This function can generate numbers with-in a given range. The random number generator should be seeded to prevent a regular pattern of numbers being generated. This is achieved using the srand() function that specifies the seed number as its argument.

 176 views

188⟩ How will you start a session in PHP?

A PHP session is easily started by making a call to the session_start() function.This function first checks if a session is already started and if none is started then it starts one. It is recommended to put the call to session_start() at the beginning of the page.

 210 views

189⟩ What is the purpose of php.ini file?

The PHP configuration file, php.ini, is the final and most immediate way to affect PHP's functionality. The php.ini file is read each time PHP is initialized.in other words, whenever httpd is restarted for the module version or with each script execution for the CGI version. If your change isn.t showing up, remember to stop and restart httpd. If it still isn.t showing up, use phpinfo() to check the path to php.ini.

 197 views

191⟩ How will you open a file in readonly mode?

The PHP fopen() function is used to open a file. It requires two arguments stating first the file name and then mode in which to operate. "r" mode opens the file for reading only and places the file pointer at the beginning of the file.

 199 views

194⟩ What do you mean by having PHP as whitespace insensitive?

Whitespace is the stuff you type that is typically invisible on the screen, including spaces, tabs, and carriage returns (end-of-line characters). PHP whitespace insensitive means that it almost never matters how many whitespace characters you have in a row.one whitespace character is the same as many such characters.

 193 views

195⟩ What is associate array in PHP?

Associative array − An array with strings as index. This stores element values in association with key values rather than in a strict linear index order.

 197 views

198⟩ What is the purpse $_REQUEST variable?

The PHP $_REQUEST variable contains the contents of both $_GET, $_POST, and $_COOKIE. We will discuss $_COOKIE variable when we will explain about cookies. The PHP $_REQUEST variable can be used to get the result from form data sent with both the GET and POST methods.

 177 views