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)
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)
Ans: $_SERVER is a PHP variable that contains all web server information It is known as a superglobal.
Ans: By looking at the output of the phpinfo() function.
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.
Ans: There are many text editors and Integrated Development Environments you can use to create, edit and manage PHP files.
Ans: A linefeed that follows immediately after a closing ?> will be removed by PHP.
Ans: Line feeds have little meaning in HTML, however it is still a good idea to make Your HTML look nice.
Ans: Using Starting (< ?) and closing (? >) tag we can jump in and out of PHP mode in a HTML file.
Ans: To start PHP tag- <?
To close a php tag- ?>
Ans:http://localhost/hello.php.
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>
Ans: .php are handled by the PHP.
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.
Ans: we can access objects by using CORBA extension.
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.
Ans: (i) MYSQL
(ii) Direct MS-SQL
(iii)Sybase
(iv) ODBC
(v) oracle(OC 17 and OC 18)
(vi) mSQL
(vii)FrontBase
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.
Ans: (i) Apache
(ii) MicroSoft Internet Information Server
(iii) personal web server
(iv)Netscape
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
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.
© PHPInterviewQuestion.com 2009 - 2012