Monthly archive for May 2010

Q How can we display $_SERVER variable ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans: To display this variable-

Example:-  Printing a ws variable (Array element):-

<?php
echo $_SERVER['HTTP_USER_AGENT'];
?>
A sample output of this script may be:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

Article written by admin

Q Where the all webserver information is stored in PHP ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans: $_SERVER is a PHP variable that contains all web server information It is known as a superglobal.

Article written by admin

Q How can you get the complete list of the PHP variables ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans: By looking at the output of the phpinfo() function.

Article written by admin

Q If you are writing your PHP scripts using windows notepad, you will need to ensure that your files are saved with the .php extension.But notepad adds a .txt extension to files automatically, Now how can we prevent this ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans: We have to choose one of the following steps to prevent it-

(i) When you save the file and are prompted to provide a name for the file,
place the filename  in quotes (i.e. “hello.php”).
(ii) you can click on the ‘Text Documents’dialog box and change the setting to “All Files”.
You can then enter your filename without quotes.

Article written by admin

Q What do you mean by Text Editors? And list the some PHP editors ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans: There are many text  editors and Integrated Development Environments you can use to create, edit and manage PHP files.

Article written by admin

Q How can we remove a linefeed ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans: A linefeed that follows immediately after a closing ?> will be removed by PHP.

Article written by admin

Q What do you mean by linefeed ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans: Line feeds have little meaning in HTML, however it is still a good idea to make Your HTML look nice.

Article written by admin

Q how can we jump in and out of PHP mode in an HTML file ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans: Using Starting (< ?) and closing (? >) tag we can jump in and out of PHP mode in  a HTML file.

Article written by admin

Q How can we start and close a PHP tag ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans: To start PHP tag-  <?
To close a php tag- ?>

Article written by admin

Q How can we access the above file if we developing locallay ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans:http://localhost/hello.php.

Article written by admin

Q How can we create a PHP enabled Page ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans: Firstly-
Create a file named hello.php and put it in your web server’s root
Directory  (DOCUMENT-ROOT).
Example:

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo ’<p>Hello World</p>’; ?>
</body>
</html>

Article written by admin

Q Which type of files handled by PHP ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans: .php are handled by the PHP.

Article written by admin

Q How can be parsing and accessing XML documents using PHP ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans: PHP has extremely useful text processing features-
(i) from the POSIX Extended regular is expressions to parsing XML
Documents PHP 4 supports the SAX and DOM standards.
(ii) you can also use the XSLT extension to transform XML documents.

Article written by admin

Q How can you access the remote objects in PHP ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans: we can access objects by using CORBA extension.

Article written by admin

Q Can you define Interconnection in PHP ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans:  PHP has support for instantiation of Java objects and using  them transparently-
As PHP objects .You can also use our CORBA extension to access remote Objects.

Article written by admin

Q Write the name of some databases that are currently supported to PHP ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans: (i) MYSQL
(ii) Direct  MS-SQL
(iii)Sybase
(iv) ODBC
(v)  oracle(OC 17 and OC 18)
(vi) mSQL
(vii)FrontBase

Article written by admin

Q what are the PHP abilities ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans: (i) Outputting images
(ii) Pdf files
(iii) And even Flash movies( using generated on the fly)
(iv) You  can also output any text, such as XHTML an any other XML file
(v) PHP can autogenerate these files and save them in the file system
(vi)instead of printing it(these files)  coupons out,forming a server side cache for your
your dynamic  content.

Article written by admin

QWrite name of the web servers to which PHP supports ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans:  (i) Apache
(ii)  MicroSoft Internet Information Server
(iii) personal web server
(iv)Netscape

Article written by admin

Q write the name of some operating systems of Php on which PHP can be used ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans: Following are the operating systems on which PHP can be used-
(i)Linux
(ii)Many Unix variants( including HP-UX, Solaris and  open BSD)
(iii)MicroSoft Windows
(iv)Mac OS

Article written by admin

Q What is command line Sripting ?

May 31, 2010 | Filed Under PHP | Comments Off

Ans: In this You can make a PHP script to run it without any server or browser. You  only need the PHP parser to use it this way.

Article written by admin

© PHPInterviewQuestion.com 2009 - 2012

eXTReMe Tracker