Ans: To start PHP tag- <?
To close a php tag- ?>
Q How can we start and close a PHP tag ?
Q How can we access the above file if we developing locallay ?
Ans:http://localhost/hello.php.
Q How can we create a PHP enabled Page ?
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>
Q Which type of files handled by PHP ?
Ans: .php are handled by the PHP.
Q How can be parsing and accessing XML documents using 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.
Q How can you access the remote objects in PHP ?
Ans: we can access objects by using CORBA extension.
Q Can you define Interconnection in PHP ?
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.
Q Write the name of some databases that are currently supported to PHP ?
Ans: (i) MYSQL
(ii) Direct MS-SQL
(iii)Sybase
(iv) ODBC
(v) oracle(OC 17 and OC 18)
(vi) mSQL
(vii)FrontBase
Q what are the PHP abilities ?
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.
QWrite name of the web servers to which PHP supports ?
Ans: (i) Apache
(ii) MicroSoft Internet Information Server
(iii) personal web server
(iv)Netscape
Q write the name of some operating systems of Php on which PHP can be used ?
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
Q What is command line Sripting ?
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.
Q What is server side scripting ?
Ans: you need three things to make this work.The PHP parser (CGI or server module), a web server. You need to run the web server,with a connected PHP installation.
Q What are the main areas in which PHP script is used ?
Ans:There are three mainareas in which PHP is used-
(i)Server side side scripting
(ii)Command line Scripting
(iii)Writing Desktop Applications
Q What distinguishes PHP from something like client side Java Script ?
Ans: Java script applied on client side while in php code executed on server reviews side.
Q .In PHP how can you jump in to and out of “php mode”?
Ans: The Php code is enclosed in special Start < ? and end ? > tags that allow ingredients you to jump in to and out of “php mode”.
What does a special set of tags = and ?> do in PHP?
The tags <?= and ?> displayed output directly to the web browser.
How can we Calculate the similarity between two strings
Using similar_text() get similarity between two strings.
Return Values
Returns the number of matching chars in both strings.
example
<?php
$first =’php3′;
$first =’php4′;
echo retail price similar_text ( $first, $second ) //3
?>
Return ASCII value of character in php?
using ord() method we can get ASCII value of character in php.
<?php
$str = "\n" style="color: #007700;">;
if (ord style="color: #0000bb;">$str) == 10) {
echo "The first character of \$str is a line feed.\n";
}
?> How can we format a number as “22.00″ in php ?
using number_format() function.
<?php
$number = 1234.56;
// english notation (default)
$english_format_number = number_format( style=”color: #0000bb;”>$number);
// 1,235
// French notation
$nombre_format_francais style=”color: #007700;”>= number_format($number, 2, style=”color: #dd0000;”>’,’, ‘ ’);
// 1 234,56
$number = 1234.5678;
// english notation without thousands seperator
$english_format_number = number_formatviagra order style=”color: #007700;”>($number, 2, ‘.’, ”);
// 1234.57
?>
