Ans. The PHP Hypertext Preprocessor is a programming language that allows web developers to
create dynamic content that interacts with databases. PHP is basically used for developing web
based software applications.
Q.2- Who is the father of PHP and explain the changes in PHP versions?
Ans. Rasmus Lerdorf is known as the father of PHP.PHP/FI 2.0 is an early and no longer
supported version of PHP. PHP 3is the successor to PHP/FI 2.0 and is a lot nicer. PHP 4 is the
current generation of PHP, which uses theZend engine under the hood.
PHP 5 uses Zend engine 2 which,among other things, offers many additionalOOP features.
Q.3- What is the difference between mysql_fetch_object and
mysql_fetch_array?
Ans. mysql_fetch_object() is similar to mysql_fetch_array(), with one difference -an object is
returned, instead of an array. Indirectly, that means that
you can only access the data by the field names, and not by their offsets (numbers are illegal
property names).
Q.4- What is the difference between $message and $$message?
Ans. It is a classic example of PHP’s variable variables. take the
following example.
$message = “Mizan”;
$$message = “is a moderator of PHPXperts.”;
$message is a simple PHP variable that we are used to. But the $$message is not a very familiar
face. It creates a variable name $mizan with the value “is a moderator of PHPXperts.” assigned.
break it like this
${$message} => $mizanSometimes it is convenient to be able to have variable variable names.
That is, a variable name which can be set and used dynamically.
Q.5- How can we extract string ‘abc.com ‘ from a string’http://info@abc.com’
using regular expression of PHP?
Ans. preg_match(“/^http:\/\/.+@(.+)$/”,‘http://info@abc.com’,$found);echo $found[1];
Q.6- How can we create a database using PHP and MySQL?
,Ans. We can create MySQL database with the use of
mysql_create_db(“Database Name”)
Q.7- What are the differences between require and include,
include_once and require_once?
Ans. The include() statement includes and evaluates the specified file.The documentation below
also applies to require(). The two constructs are identical in every way except how they handle
failure. include() produces a Warning while require() results in a Fatal Error. In other words,
use require() if you want a missing file to halt processing of the page. include() does not behave
this way, the script will continue regardless.
The include_once() statement includes and evaluates the specified file during the execution of
the script. This is a behavior similar to the include() statement, with the only differencebeing that
if the code from a file has already been included, it will not be included again. As the name
suggests, it will be included just once.include_once()should be used in cases where the same
file might be included and evaluated more than once during a particular execution of a script, and
you want to be sure that it is included exactly once to avoid problems with function redefinitions,
variable value reassignments, etc.
require_once() should be used in cases where the same file might be included and evaluated
more than once during a particular execution of a script, and you want to be sure that it is
included exactly once to avoid problems with function redefinitions, variable value
reassignments, etc.
Q.8- Can we use include (“abc.PHP”) two times in a PHP page “makeit.PHP”?
Ans. Yes we can use include() more than one time in any page though it is not a very good
practice.
Q.9 What are the different tables present in MySQL, which type of table is generated when we
are creating a table in the following syntax:
create table employee (eno int(2),ename varchar(10)) ?
Ans. Total 5 types of tables we can create
1. MyISAM
2. Heap
3. Merge
, 4. INNO DB
5. ISAM
MyISAM is the default storage engine as of MySQL 3.23 and as a result if
we do not specify the table name explicitly it will be assigned to the
default engine.
Q.10 What is meant by nl2br()?
Ans. Inserts HTML line breaks (
) before all newlines in a string string nl2br (string); Returns string with ” inserted before all
newlines. For example: echo nl2br(“god bless\n you”) will output “god
bless
you” to your browser.
Q.11 What are the current versions of apache, PHP, and MySQL?
Ans. As of February, 2007 the current versions arePHP: php5.2.1
MySQL: MySQL 5.2
Apache: Apache 2.2.4Note: visit www.php.net,
http://dev.mysql.com/downloads/mysql/
www.apache.org to get current versions.
Q.12 What are the reasons for selecting lamp (Linux, apache, MySQL,PHP) instead of
combination of other software programs, servers and
operating systems?
Ans. All of those are open source resource. Security of Linux is very very more than windows.
Apache is a better server that IIS both in
functionality and security. MySQL is world most popular open source database. PHP is more
faster that asp or any other scripting language.
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through EFT, credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying this summary from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller chiranjeevijami. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy this summary for R139,80. You're not tied to anything after your purchase.