August 27, 2019

Srikaanth

Red Hat PHP Most Frequently Asked Interview Questions

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.

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

$second = date("s");
Red Hat PHP Most Frequently Asked Latest Interview Questions Answers
Red Hat PHP Most Frequently Asked Latest Interview Questions Answers

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

How To Set Cookies?

setcookie('variable','value','time')
;
variable - name of the cookie variable
value - value of the cookie variable
time - expiry time
Example:

setcookie('Test',$i,time()+3600);
Test - cookie variable name
$i - value of the variable 'Test'
time()+3600 - denotes that the cookie will expire after an one hour.

How Can We Increase The Execution Time Of A Php Script?

By the use of void set_time_limit(int seconds) Set the number of seconds a script is allowed to run. If this is reached, the script returns a fatal error. The default limit is 30 seconds or, if it exists, the max_execution_time value defined in the php.ini. If seconds is set to zero, no time limit is imposed.

When called, set_time_limit() restarts the timeout counter from zero. In other words, if the timeout is the default 30 seconds, and 25 seconds into script execution a call such as set_time_limit(20) is made, the script will run for a total of 45 seconds before timing out.

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.

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

What Is A Cookie?

A cookie is a small amount of information sent by a Web server to a web browser and then sent back unchanged by the browser each time it accesses that server. HTTP cookies are used for authenticating, tracking, and maintaining specific information about users, such as site preferences and the contents of their electronic shopping carts. The term "cookie" is derived from "magic cookie", a well-known concept in computing which inspired both the idea and the name of HTTP cookies.
A cookie consists of a cookie name and cookie value.

How To Send A Cookie To The Browser?

If you want to sent a cookie to the browser when it comes to request your PHP page, you can use the setcookie( ) function. Note that you should call setcookie() function before any output statements. The following script shows you how to set cookies:
<?php
setcookie("LoginName","XYZ");
setcookie("PreferredColor","Blue");
print("2 cookies were delivered.\n");
?>

How To Receive A Cookie From The Browser?

If you know that a cookie has been sent to the browser when it was visiting the server previously, you can check the built-in $_COOKIE array, which contains all cookies that were sent by the server previously. The script below shows you how to pickup one cookie from the $_COOKIE and loop through all cookies in $_COOKIE:
<?php
if (isset($_COOKIE["LoginName"])) {
$loginName = $_COOKIE["LoginName"];
print("Received a cookie named as LoginName: ".$loginName."\n");
} else {
print("Did not received any cookie named as LoginName.\n");
}
print("All cookies received:\n");
foreach ($_COOKIE as $name => $value) {
print " $name = $value\n";
}
?>

How Cookies Are Transported From Servers To Browsers?

Cookies are transported from a Web server to a Web browser in the header area of the HTTP response message. Each cookie will be included in a separate "Set-Cookie:" header line in the following format:
Set-Cookie: name=value; expires=time; path=pathVal; domain=domainVal.

How Cookies Are Transported From Browsers To Servers?

Cookies are transported from a Web browser to a Web server in the header area of the HTTP request message. Each cookie will be included in a separate "Cookie:" header line in the following format:
GET / HTTP/1.1
Cookie: name1=value1
Cookie: name2=value2
Cookie: name3=value3
......
Accept: */*.

Subscribe to get more Posts :