Hewlett-Packard PHP Interview Questions Answers

What Are The Difference Between Abstract Class And Interface?

Abstract class: abstract classes are the class where one or more methods are abstract but not necessarily all method has to be abstract. Abstract methods are the methods, which are declare in its class but not define. The definition of those methods must be in its extending class.

Interface: Interfaces are one type of class where all the methods are abstract. That means all the methods only declared but not defined. All the methods must be define by its implemented class

Can We Use Include(abc.php) Two Times In A Php Page Makeit.php?

Yes we can include that many times we want, but here are some things to make sure of: (including abc.PHP, the file names are case-sensitive) there shouldn't be any duplicate function names, means there should not be functions or classes or variables with the same name in abc.PHP and makeit.php.

How Can I Make A Script That Can Be Bilingual (supports English, German)?

You can change char set variable in above line in the script to support bi language.

What Is The Maximum Size Of A File That Can Be Uploaded Using Php And How Can We Change This?

You can change maximum size of a file set upload_max_filesize variable in php.ini file.
Hewlett-Packard PHP Most Frequently Asked Latest Interview Questions Answers
Hewlett-Packard PHP Most Frequently Asked Latest Interview Questions Answers

How Can We Get Second Of The Current Time Using Date Function?

$second = date("s");

Who Is The Father Of Php And What Is The Current Version Of Php And Mysql?
Rasmus Lerdorf.
PHP 5.1. Beta
MySQL 5.0

Tools Used For Drawing Er Diagrams?
Case Studio.
Smart Draw.

In How Many Ways We Can Retrieve Data In The Result Set Of Mysql Using Php?
mysql_fetch_array - Fetch a result row as an associative array, a numeric array, or both
mysql_fetch_assoc - Fetch a result row as an associative array
mysql_fetch_object - Fetch a result row as an object
mysql_fetch_row - Get a result row as an enumerated array

What Are The Functions For Imap?
imap_body - Read the message body
imap_check - Check current mailbox
imap_delete - Mark a message for deletion from current mailbox
imap_mail - Send an email message

Check If A Variable Is An Integer In Javascript ?
var myValue =9.8;
if(parseInt(myValue)== myValue)
alert('Integer');
else
alert('Not an integer');

What Are Encryption Functions In Php?

CRYPT()
MD5()

What Types Of Images That Php Supports ?

Using imagetypes() function to find out what types of images are supported in your PHP engine.

imagetypes() - Returns the image types supported.

This function returns a bit-field corresponding to the image formats supported by the version of GD linked into PHP. The following bits are returned, IMG_GIF | IMG_JPG | IMG_PNG | IMG_WBMP | IMG_XPM.

What Is The Difference Between Htmlentities() And Htmlspecialchars()?
htmlspecialchars() - Convert some special characters to HTML entities (Only the most widely used)

htmlentities() - Convert ALL special characters to HTML entities.

How To Reset/destroy A Cookie ?
Reset a cookie by specifying expire time in the past:
Example: setcookie('Test',$i,time()-3600); // already expired time
Reset a cookie by specifying its name only
Example: setcookie('Test');

What Are The Different Ways To Login To A Remote Server? Explain The Means, Advantages And Disadvantages?

There is at least 3 ways to logon to a remote server:
Use ssh or telnet if you concern with security
You can also use rlogin to logon to a remote server.

What Is Meant By Mime?
MIME is Multipurpose Internet Mail Extensions is an Internet standard for the format of e-mail. However browsers also uses MIME standard to transmit files. MIME has a header which is added to a beginning of the data. When browser sees such header it shows the data as it would be a file (for example image) Some examples of MIME types:

audio/x-ms-wmp
image/png
application/x-shockwave-flash

What Is The Difference Between Group By And Order By In Sql?
To sort a result, use an ORDER BY clause.
The most general way to satisfy a GROUP BY clause is to scan the whole table and create a new temporary table where all rows from each group are consecutive, and then use this temporary table to discover groups and apply aggregate functions (if any). ORDER BY [col1],[col2],...[coln]; Tells DBMS according to what columns it should sort the result. If two rows will have the same value in col1 it will try to sort them according to col2 and so on.

GROUP BY [col1],[col2],...[coln]; Tells DBMS to group (aggregate) results with same value of column col1. You can use COUNT(col1), SUM(col1), AVG(col1) with it, if you want to count all items in group, sum all values or view average.

Who Is The Father Of Php And Explain The Changes In Php Versions?
Rasmus Lerdorf is known as the father of PHP.PHP/F1 2.0 is an early and no longer supported version of PHP. PHP 3 is the successor to PHP/FI 2.0 and is a lot nicer. PHP 4 is the current generation of PHP, which uses the Zend engine under the hood. PHP 5 uses Zend engine 2 which, among other things, offers many additionalOOP features .

What Is The Functionality Of The Function Htmlentities?
htmlentities() - Convert all applicable characters to HTML entities
This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities.

How Can We Get The Properties (size, Type, Width, Height) Of An Image Using Php Image Functions?

To know the image size use getimagesize() function
To know the image width use imagesx() function
To know the image height use imagesy() function.


Post a Comment

Previous Post Next Post