YouTube Icon

Interview Questions.

Top 100+ Php+mysql Interview Questions And Answers - Jun 01, 2020

fluid

Top 100+ Php+mysql Interview Questions And Answers

Question 1. Who Is The Father Of Php And Explain The Changes In Php Versions?

Answer :

Rasmus Lerdorf is called the father of PHP. PHP/FI 2.0 is an early and no longer supported version of PHP. PHP three is the successor to PHP/FI 2.0 and is a lot nicer. PHP four is the modern era of PHP, which makes use of the Zend engine below the hood. PHP five makes use of Zend engine 2 which, among different things, offers many extra OOP functions

Question 2. How Can We Submit A Form Without A Submit Button?

Answer :

The main idea in the back of this is to apply Java script submit() feature with the intention to put up the form with out explicitly clicking any submit button. You can connect the report.Formname.Put up() technique to onclick, onchange activities of various inputs and perform the shape submission. You may even constructed a timer feature wherein you can automatically submit the form after xx seconds as soon as the loading is accomplished (can be seen in online test web sites).

PHP Interview Questions
Question 3. In How Many Ways We Can Retrieve The Data In The Result Set Of Mysql Using Php?

Answer :

You can do it by four Ways

mysql_fetch_row.
Mysql_fetch_array
mysql_fetch_object
mysql_fetch_assoc
Question 4. What Is The Difference Between Mysql_fetch_object And Mysql_fetch_array?

Answer :

mysql_fetch_object() is much like mysql_fetch_array(), with one difference - an object is again, rather than an array. Indirectly, that means that you may simplest get entry to the data by the sphere names, and now not via their offsets (numbers are unlawful assets names).

PHP Tutorial
Question 5. What Is The Difference Between $message And $$message?

Answer :

It is a classic instance of PHP’s variable variables. Take the subsequent instance.$message = “Mizan”;$$message = “is a moderator of PHPXperts.”;$message is a simple PHP variable that we're used to. But the $$message is not a completely familiar face. It creates a variable name $mizan with the cost “is a moderator of PHPXperts.” assigned. Break it like this$$message => $mizanSometimes it's miles handy as a way to have variable variable names. That is, a variable call which may be set and used dynamically.

MySQL Interview Questions
Question 6. How Can We Create A Database Using Php And Mysql?

Answer :

We can create MySQL database with the use of mysql_create_db(“Database Name”)

Question 7. Can We Use Include ("abc.Php") Two Times In A Php Page "makeit.Php"?

Answer :

Yes we are able to use encompass() more than one time in any page though it is not a excellent practice.

MySQL Tutorial Drupal Interview Questions
Question eight. 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)) ?

Answer :

Total five sorts of tables we can create

MyISAM
Heap
Merge
INNO DB
ISAM
MyISAM is the default storage engine as of MySQL 3.23 and as a result if we do now not specify the desk call explicitly it will be assigned to the default engine.

Question 9. Functions In Imap, Pop3 And Ldap?

Answer :

You can find these particular statistics in PHP Manual.

MYSQL DBA Interview Questions
Question 10. How Can I Execute A Php Script Using Command Line?

Answer :

As of model four.Three.Zero, PHP helps a new SAPI type (Server Application Programming Interface) named CLI which means that Command Line Interface. Just run the PHP CLI (Command Line Interface) software and provide the PHP script report name as the command line argument. For example, “php myScript.Personal home page”, assuming “php” is the command to invoke the CLI application.

Be aware that in case your PHP script was written for the Web CGI interface, it is able to no longer execute well in command line surroundings.

Drupal Tutorial
Question 11. Suppose Your Zend Engine Supports The Mode <? ?> Then How Can U Configure Your Php Zend Engine To Support <?Php ?> Mode ?

Answer :

In Hypertext Preprocessor.Ini document: set short_open_tag=on to make PHP aid

PHP5 Interview Questions
Question 12. What Is Meant By Nl2br()?

Answer :

Inserts HTML line breaks (<BR/>) earlier than all newlines in a string string nl2br (string); Returns string with ” inserted before all newlines. For instance: echo nl2br(“god blessn you”) will output “god bless <br/>you” in your browser.

PHP Interview Questions
Question thirteen. What Are The Reasons For Selecting Lamp (linux, Apache, Mysql, Php) Instead Of Combination Of Other Software Programs, Servers And Operating Systems?

Answer :

All of these are open source useful resource. Security of Linux is very very more than windows. Apache is a better server that IIS each in functionality and security. MySQL is international maximum popular open source database. PHP is extra quicker that asp or every other scripting language.

WordPress Tutorial
Question 14. How Can We Encrypt And Decrypt A Data Present In A Mysql Table Using Mysql?

Answer :

AES_ENCRYPT () and AES_DECRYPT ()

Question 15. What Are The Features And Advantages Of Object-oriented Programming?

Answer :

One of the main blessings of programming is its ease of change; gadgets can easily be modified and delivered to a device there by decreasing upkeep prices.

Programming is likewise taken into consideration to be better at modeling the actual world than is procedural programming. It allows for extra complicated and flexible interactions.

Systems are also less difficult for non-technical personnel to apprehend and simpler for them to participate within the preservation and enhancement of a gadget as it appeals to herbal human cognition styles. For some structures, an method can velocity improvement time in view that many gadgets are general across systems and may be reused. Components that manipulate dates, transport, purchasing carts, and many others. May be purchased and effortlessly modified for a particular machine

WordPress Interview Questions
Question sixteen. What Is The Use Of Friend Function?

Answer :

Sometimes a function is great shared among a number of distinct instructions. Such capabilities can be declared both as member features of 1 class or as global capabilities. In both case they can be set to be buddies of other classes, by the usage of a pal specifier inside the class this is admitting them. Such features can use all attributes of the elegance which names them as a friend, as if they have been themselves members of that elegance.

A buddy statement is basically a prototype for a member feature, but instead of requiring an implementation with the call of that class connected via the double colon syntax, a worldwide characteristic or member function of every other magnificence affords the in shape.

Joomla Tutorial
Question 17. What Is The Functionality Of The Function Htmlentities?

Answer :

Convert all applicable characters to HTML entities This characteristic is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters that have HTML character entity equivalents are translated into these entities.

Joomla Interview Questions
Question 18. How Can We Get Second Of The Current Time Using Date Function?

Answer :

$second = date(“s”);

MySQL Interview Questions
Question 19. What Is The Difference Between The Functions Unlink And Unset?

Answer :

unlink() deletes the given record from the record gadget.

Unset() makes a variable undefined.

CakePHP Tutorial
Question 20. How Can We Register The Variables Into A Session?

Answer :

$_SESSION[’name’] = “Mizan”;

CakePHP Interview Questions
Question 21. How Can We Get The Properties (size, Type, Width, Height) Of An Image Using Php Image Functions?

Answer :

To recognize the Image type use exif_imagetype ()
function To recognise the Image size use getimagesize ()
feature To recognise the photograph width use imagesx ()
feature To realize the picture height use imagesy() function t

Question 22. How Can We Get The Browser Properties Using Php?

Answer :

By the use of $_SERVER['HTTP_USER_AGENT'] variable.

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

Answer :

By default the maximum length is 2MB. And we will trade the following installation a php.Iniupload_max_filesize = 2M

CodeIgniter Interview Questions
Question 24. How Can We Increase The Execution Time Of A Php Script?

Answer :

by means of changing the subsequent set up a php.Inimax_execution_time = 30 ; Maximum execution time of every script, in seconds

Drupal Interview Questions
Question 25. How Can We Optimize Or Increase The Speed Of A Mysql Select Query?

Answer :

to start with in preference to the usage of select * from table1, use select column1, column2, column3.. From table1
Look for the opportunity to introduce index in the desk you're querying.
Use limit keyword if you are searching out any particular variety of rows from the result set.
PHP7 Tutorial
Question 26. How Many Ways Can We Get The Value Of Current Session Id?

Answer :

session_id() returns the session identity for the cutting-edge session.

PHP7 Interview Questions
Question 27. How Can We Destroy The Session, How Can We Unset The Variable Of A Session?

Answer :

session_unregister — Unregister a global variable from the current session session_unset — Free all session variables

MYSQL DBA Interview Questions
Question 28. How Can We Destroy The Cookie?

Answer :

Set the cookie in beyond.

Question 29. How Many Ways We Can Pass The Variable Through The Navigation Between The Pages?

Answer :

GET/QueryString
POST
Question 30. What Is The Difference Between Ereg_replace() And Eregi_replace()?

Answer :

eregi_replace() feature is equal to ereg_replace() besides that this ignores case distinction when matching alphabetic characters.Eregi_replace() function is equal to ereg_replace() besides that this ignores case difference whilst matching alphabetic characters.

Question 31. What Are The Different Functions In Sorting An Array?

Answer :

Sort(), arsort(), asort(), ksort(), natsort(), natcasesort(), rsort(), usort(), array_multisort(), and uksort().

Question 32. How Can We Know The Count/quantity Of Elements Of An Array?

Answer :

2 approaches

sizeof($urarray) This function is an alias of count number()
count($urarray)
 

Question 33. What Is The Php Predefined Variable That Tells The What Types Of Images That Php Supports?

Answer :

Though i am not sure if this is incorrect or no longer, With the exif extension you're capable of paintings with photograph meta records.

PHP5 Interview Questions
Question 34. How Can I Know That A Variable Is A Number Or Not Using A Javascript?

Answer :

bool is_numeric ( combined var) Returns TRUE if var is a range of or a numeric string, FALSE otherwise.Or use isNaN(mixed var)The isNaN() feature is used to check if a price isn't a number of.

Question 35. List Out Some Tools Through Which We Can Draw E-r Diagrams For Mysql.

Answer :

Case Studio

Smart Draw

Question 36. List Out The Predefined Classes In Php?

Answer :

You can maintain  separate language record for each of the language. All of the labels are installed each language documents as variables and assign those variables within the PHP source. On runtime pick out the specified language alternative.

WordPress Interview Questions
Question 37. What Are The Difference Between Abstract Class And Interface?

Answer :

Abstract elegance: summary lessons are the elegance where one or greater techniques are abstract but not necessarily all method must be abstract. Abstract strategies are the techniques, which might be declare in its elegance however no longer define. The definition of those strategies have to be in its extending magnificence.Interface: Interfaces are one kind of elegance wherein all the methods are abstract. That means all of the strategies only declared however now not described. All the techniques ought to be described through its implemented elegance.

Question 38. How Can We Send Mail Using Javascript?

Answer :

JavaScript does now not have any networking abilties as it is designed to work on consumer website online. As a end result we can't ship mails the usage of JavaScript. But we will call the purchaser facet mail protocol mailto through JavaScript to spark off for an electronic mail to ship. This requires the purchaser to approve it.

Question 39. How Can We Repair A Mysql Table?

Answer :

The syntex for repairing a MySQL table is REPAIR TABLENAME, [TABLENAME, ], [Quick],[Extended] This command will repair the table distinct if the short is given the MySQL will do a repair of most effective the index tree if the prolonged is given it'll create index row by way of row

Question forty. How Many Values Can The Set Function Of Mysql Take?

Answer :

MySQL set can take zero or extra values however at the most it may take 64 values

Joomla Interview Questions
Question forty one. What Are The Other Commands To Know The Structure Of Table Using Mysql Commands Except Explain Command?

Answer :

describe Table-Name;

Question forty two. How Many Tables Will Create When We Create Table, What Are They?

Answer :

The ‘.Frm’ file stores the table definition.
The statistics record has a ‘.MYD’ (MYData) extension.
The index report has a ‘.MYI’ (MYIndex) extension.

CakePHP Interview Questions
Question 43. What Is The Purpose Of The Following Files Having Extensions

.Frm
.Myd
.Myi? What Do These Files Contain?
Answer :

In MySql, the default desk type is MyISAM. Each MyISAM desk is stored on disk in 3 documents. The files have names that start with the desk name and have an extension to suggest the report type.

The ‘.Frm’ document shops the desk definition. The facts file has a ‘.MYD’ (MYData) extension. The index file has a ‘.MYI’ (MYIndex) extension,

Question forty four. How Can We Find The Number Of Rows In A Table Using Mysql?

Answer :

Use this for mysql >SELECT COUNT(*) FROM table_name;

Question forty five. How Can We Find The Number Of Rows In A Result Set Using Php?

Answer :

$end result = mysql_query($sq., $db_link);
$num_rows = mysql_num_rows($end result);
echo "$num_rows rows found";

Question forty six. How Many Ways We Can We Find The Current Date Using Mysql?

Answer :

SELECT CURDATE();
CURRENT_DATE() = CURDATE()
for time use
SELECT CURTIME();
CURRENT_TIME() = CURTIME()
Question 47. What Type Of Inheritance That Php Supports?

Answer :

In PHP an prolonged magnificence is continually depending on a unmarried base class, this is, multiple inheritance is not supported. Classes are prolonged the use of the keyword ‘extends’.

Question 48. What Are The Advantages/negative aspects Of Mysql And Php?

Answer :

Both of them are open source software (so free of price), help pass platform. Hypertext Preprocessor is faster then ASP and JSP.

Question forty nine. What Is The Difference Between Group By And Order By In Sql?

Answer :

ORDER BY [col1],[col2],…,[coln]; Tels DBMS in line with what columns it must sort the end result. If  rows will hawe the same fee in col1 it'll try and sort them in step with col2 and so forth.GROUP BY [col1],[col2],…,[coln]; Tels DBMS to organization effects with identical price of column col1. You can use COUNT(col1), SUM(col1), AVG(col1) with it, if you want to remember all gadgets in institution, sum all values or view common.

Question 50. What Is The Difference Between Char And Varchar Data Types?

Answer :

Set char to occupy n bytes and it will take n bytes even though u r storing a cost of n-m bytes

Set varchar to occupy n bytes and it's going to take only the desired space and will no longer use the n bytes

eg. Name char(15) will waste 10 bytes if we store ‘mizan’, if each char takes a byte

eg. Call varchar(15) will simply use five bytes if we keep ‘mizan’, if every char takes a byte.

Relaxation 10 bytes will be free.

Question fifty one. What Is The Functionality Of Md5 Function In Php?

Answer :

Calculate the md5 hash of a string. The hash is a 32-individual hexadecimal number. I use it to generate keys which I use to identify users and many others. If I add random no strategies to it the md5 generated now may be absolutely specific for the equal string I am the use of.

Question 52. How Can I Load Data From A Text File Into A Table?

Answer :

you could use LOAD DATA INFILE file_name; syntax to load statistics from a text file. However you have to make certain that

information is delimited
columns and facts matched effectively
Question fifty three. How Can We Know The Number Of Days Between Two Given Dates Using Mysql?

Answer :

SELECT DATEDIFF(’2007-03-07′,’2005-01-01′);
Question 54. How Can We Know The Number Of Days Between Two Given Dates Using Php?

Answer :

$date1 = date(‘Y-m-d’);
$date2 = ’2006-08-15′;
$days = (strtotime($date1) – strtotime($date2)) / (60 * 60 * 24);
Question fifty five. What Is 'drift' Property In Css?

Answer :

The glide assets units wherein an photograph or a text will appear in any other detail.

Question fifty six. Are Namespaces Are There In Javascript?

Answer :

A namespace is a box and permits you to package up all of your capability the use of a unique name. In JavaScript, a namespace is truely simply an object which you’ve attached all similarly methods, residences and objects. But it isn't constantly vital to use namespace.

Question 57. How To Get Query String In Php For Http Request?

Answer :

$_GET[] and $_REQUEST[]
Question fifty eight. How To Get The Http Request In Php?

Answer :

When PHP is used on a Web server to address a HTTP request, it converts information submitted within the HTTP request as predefined variables:

$_GET - Associate array of variables submitted with GET method.
$_POST - Associate array of variables submitted with POST method.
$_COOKIE - Associate array of variables submitted as cookies.
$_REQUEST - Associate array of variables from $_GET, $_POST, and $_COOKIE.
$_SERVER - Associate array of all data from the server and the HTTP request.
Question 59. How You Provide Security For Php Application?

Answer :

There are many approaches to perform the security tasks but the maximum commonplace 7 approaches are

Validate Input. Never consider your person and constantly clear out input before taking it to any operation.
Provide get entry to manage.
Session ID protection
preventing Cross Site Scripting (XSS) flaws
SQL injection vulnerabilities.
Turning off blunders reporting and exposing to the website online for hackers. Instead use log document to seize exceptions
Effective Data coping with
Question 60. What Is A Session?

Answer :

A consultation is a logical object created via the PHP engine to can help you preserve statistics across subsequent HTTP requests.

There is only one session object to be had in your PHP scripts at any time. Data stored to the consultation through a script may be retrieved through the identical script or any other script while requested from the identical traveller.

Sessions are generally used to keep brief data to allow a couple of PHP pages to offer a entire useful transaction for the identical traveller.

Question 61. What Is Meant By Pear In Php?

Answer :

PEAR is the subsequent revolution in PHP. This repository is bringing higher degree programming to PHP. PEAR is a framework and distribution gadget for reusable PHP components. It eases installation via bringing an automatic wizard, and packing the strength and enjoy of PHP users right into a properly organised OOP library. PEAR additionally offers a command-line interface that can be used to automatically install “programs”

Question 62. What Is A Persistent Cookie?

Answer :

A persistent cookie is a cookie that's saved in a cookie file permanently on the browser’s pc. By default, cookies are created as transient cookies which saved best inside the browser’s memory. When the browser is closed, brief cookies will be erased. You have to determine when to use brief cookies and while to apply continual cookies based on their differences:

Temporary cookies cannot be used for tracking long-term facts.
Persistent cookies may be used for tracking lengthy-time period facts.
Temporary cookies are more secure due to the fact no programs apart from the browser can get admission to them.
Persistent cookies are much less comfortable due to the fact customers can open cookie files see the cookie values.
 

Question 63. What Does A Special Set Of Tags Do In Php?

Answer :

What does a unique set of tags do in PHP? The output is displayed immediately to the browser.

Question 64. How Do You Define A Constant?

Answer :

Via define() directive, like define (”MYCONSTANT”, a hundred);

Question 65. What Are The Differences Between Require And Include, Include_once?

Answer :

require_once() and include_once() are both the capabilities to consist of and compare the desired document best once. If the desired document is included preceding to the existing name incidence, it's going to not be finished once more.

But require() and encompass() will do it as many times they are asked to do.

Question 66. What Is Meant By Urlencode And Urldecode?

Answer :

urlencode() returns the URL encoded version of the given string. URL coding converts unique characters into % symptoms followed by using  hex digits.

For instance: urlencode(”10.00%”) will go back “10percent2E00%25″. URL encoded strings are safe to be used as part of URLs. Urldecode() returns the URL decoded model of the given string.

Question 67. How To Get The Uploaded File Information In The Receiving Script?

Answer :

Once the Web server received the uploaded document, it'll call the PHP script special within the form movement attribute to process them. This receiving PHP script can get the uploaded record information through the predefined array referred to as $_FILES. Uploaded file records is organized in $_FILES as a -dimensional array as:

$_FILES[$fieldName]['name'] – The Original file call at the browser gadget.
$_FILES[$fieldName]['type'] – The document kind determined via the browser.
$_FILES[$fieldName]['size'] – The Number of bytes of the file content.
$_FILES[$fieldName]['tmp_name'] – The transient filename of the document in which the uploaded report turned into saved at the server.
$_FILES[$fieldName]['error'] – The error code associated with this report upload.
The $fieldName is the name used in the<INPUT TYPE=FILE, NAME=fieldName>.

Question 68. I Am Trying To Assign A Variable The Value Of 0123, But It Keeps Coming Up With A Different Number, What's The Problem?

Answer :

PHP Interpreter treats numbers starting with zero as octal. Look at the same PHP interview questions for greater numeric troubles.

Question sixty nine. Would I Use Print "$a Dollars" Or "$a Dollars" To Print Out The Amount Of Dollars In This Example?

Answer :

In this case it wouldn’t matter, for the reason that variable is all with the aid of itself, but if you had been to print some thing like “$a,000,000 mln bucks”, you then surely want to apply the braces.

Question 70. How Can We Encrypt The Username And Password Using Php?

Answer :

You can encrypt a password with the subsequent Mysql>SET PASSWORD=PASSWORD(”Password”); 

Question 71. How Do You Pass A Variable By Value?

Answer :

Just like in C++, positioned an ampersand in front of it, like $a = &$b

Question seventy two. What Is The Functionality Of The Functions Strstr() And Stristr()?

Answer :

string strstr ( string haystack, string needle ) returns part of haystack string from the first occurrence of needle to the quit of haystack. This feature is case-sensitive.

Stristr() is same to strstr() besides that it's miles case insensitive.

Question seventy three. When Are You Supposed To Use Endif To End The Conditional Statement?

Answer :

When the original if turned into followed via : after which the code block without braces.

Question 74. What Is The Functionality Of The Function Strstr And Stristr?

Answer :

strstr() returns part of a given string from the primary incidence of a given substring to the stop of the string. For instance: strstr(”user@example.Com”,”@”) will go back “@instance.Com”.

Stristr() is idential to strstr() except that it's far case insensitive.

Question 75. How Do I Find Out The Number Of Parameters Passed Into Function9?

Answer :

func_num_args() characteristic returns the number of parameters handed in.

Question 76. What Is The Purpose Of The Following Files Having Extensions: Frm, Myd, And Myi? What These Files Contain?

Answer :

In MySQL, the default table type is MyISAM.

Each MyISAM table is saved on disk in 3 files. The files have names that begin with the table call and have an extension to indicate the file type.

The ‘.Frm’ report shops the desk definition.

The information report has a ‘.MYD’ (MYData) extension.

The index record has a ‘.MYI’ (MYIndex) extension,

Question 77. If The Variable $a Is Equal To five And Variable $b Is Equal To Character A, What's The Value Of $$b?

Answer :

five, it’s a reference to existing variable.

Question seventy eight. Are Objects Passed By Value Or By Reference?

Answer :

Everything is exceeded with the aid of value.

Question 79. What Are The Differences Between Drop A Table And Truncate A Table?

Answer :

DROP TABLE table_name – This will delete the table and its information.

TRUNCATE TABLE table_name – This will delete the statistics of the table, but now not the desk definition.

Question 80. What Are The Differences Between Get And Post Methods In Form Submitting, Give The Case Where We Can Use Get And We Can Use Post Methods?

Answer :

When we submit a form, which has the GET approach it presentations pair of name/value used in the form at the deal with bar of the browser preceded through url. Post technique doesn’t display these values.

Question eighty one. What Are The Different Types Of Errors In Php?

Answer :

Here are 3 primary forms of runtime mistakes in PHP:

Notices: These are trivial, non-essential errors that PHP encounters while executing a script – as an example, accessing a variable that has now not yet been described. By default, such errors aren't displayed to the person in any respect – although you could alternate this default conduct.
Warnings: These are extra serious errors – as an example, attempting to consist of() a document which does no longer exist. By default, those mistakes are exhibited to the user, however they do now not bring about script termination.
Fatal mistakes: These are crucial mistakes – for instance, instantiating an object of a non-existent magnificence, or calling a non-existent characteristic. These errors purpose the instantaneous termination of the script, and PHP’s default behavior is to display them to the person once they take vicinity.
Internally, these variations are represented through twelve unique mistakes kinds

Question eighty two. What's The Special Meaning Of __sleep And __wakeup?

Answer :

__sleep returns the array of all the variables than want to be stored, at the same time as __wakeup retrieves them.

Question eighty three. Why Doesn't The Following Code Print The Newline Properly? <?Php $str = 'hello, There.Nhow Are You?Nthanks For Visiting Fyicenter'; Print $str; ?>

Answer :

Because in the unmarried costs the n character isn't interpreted as newline, just as a sequence of  characters –  and n.

Question eighty four. Would You Initialize Your Strings With Single Quotes Or Double Quotes?

Answer :

Since the information within the unmarried-quoted string isn't parsed for variable substitution, it’s always a better idea speed-clever to initialize a string with single quotes, except you specially need variable substitution.

Question eighty five. What Is The Difference Between Characters 23 And x23?

Answer :

The first one is octal 23, the second one is hex 23.

Question 86. How Can We Submit Form Without A Submit Button?

Answer :

We can use a simple JavaScript code connected to an event trigger of any shape subject. In the JavaScript code, we will call the report.Shape.Submit() characteristic to put up the shape.

For example:<input type=button value=”Save” onClick=”document.Form.Submit()”>

Question 87. How Many Ways We Can Retrieve The Date In Result Set Of Mysql Using Php?

Answer :

As individual objects so unmarried record or as a hard and fast or arrays.

Question 88. What's The Output Of The Ucwords Function In This Example?

Answer :

$formatted = ucwords(”FYICENTER IS COLLECTION OF INTERVIEW QUESTIONS”);
print $formatted;

What will be published is FYICENTER IS COLLECTION OF INTERVIEW QUESTIONS.

Ucwords() makes each first letter of every word capital, but it does now not decrease-case whatever else. To keep away from this, and get a properly formatted string, it’s well worth the usage of strtolower() first.

Question 89. What's The Difference Between Htmlentities() And Htmlspecialchars()?

Answer :

htmlspecialchars simplest takes care of <, >, single quote ‘, double quote ” and ampersand. Htmlentities interprets all occurrences of person sequences that have distinctive which means in HTML.

Question 90. How Can We Extract String "wisdomjobs.Com" From A String "mailto:data@wisdomjobs.Com?Concern=feedback" Using Regular Expression Of Php?

Answer :

$text = “mailto:info@wisdomjobs.Com.Com?Difficulty.*@([^?]*)textual content, $output);
echo $output[1];
Note that the second one index of $output, $output[1], offers the suit, not the primary one, $output[0].

Question ninety one. So If Md5() Generates The Most Secure Hash, Why Would You Ever Use The Less Secure Crc32() And Sha1()?

Answer :

Crypto utilization in PHP is straightforward, but that doesn’t mean it’s free. First off, depending at the statistics which you’re encrypting, you may have motives to save a 32-bit price within the database as opposed to the a hundred and sixty-bit cost to shop on area. Second, the extra cozy the crypto is, the longer is the computation time to deliver the hash cost. A excessive quantity site might be notably bogged down, if frequent md5() era is needed.

Question ninety two. What Is The Maximum Length Of A Table Name, A Database Name, Or A Field Name In Mysql?

Answer :

Database call: sixty four characters
Table name: 64 characters
Column call: sixty four characters

Question 93. What Are The Other Commands To Know The Structure Of A Table Using Mysql Commands Except Explain Command?

Answer :

DESCRIBE table_name;

Question ninety four. What's The Difference Between Md5(), Crc32() And Sha1() Crypto On Php?

Answer :

The predominant distinction is the length of the hash generated. CRC32 is, naturally, 32 bits, at the same time as sha1() returns a 128 bit cost, and md5() returns a 160 bit cost. This is essential whilst warding off collisions.

Question 95. Give The Syntax Of Grant Commands?

Answer :

The customary syntax for GRANT is as following

GRANT [rights] on [database] TO [username@hostname] IDENTIFIED BY [password]

Now rights may be:

ALL privileges
Combination of CREATE, DROP, SELECT, INSERT, UPDATE and DELETE etc.
We can supply rights on all databse by using using *.* or some specific database by way of database.* or a particular desk by means of database.Table_name.

Question 96. Will Comparison Of String "10" And Integer 11 Work In Php?

Answer :

Yes, internally PHP will cast the whole thing to the integer kind, so numbers 10 and 11 might be compared.

Question ninety seven. How Can We Change The Name Of A Column Of A Table?

Answer :

This will exchange the call of column:

ALTER TABLE table_name CHANGE old_colm_name new_colm_name

Question ninety eight. How Can We Change The Data Type Of A Column Of A Table?

Answer :

This will alternate the data sort of a column:

ALTER TABLE table_name CHANGE colm_name same_colm_name [new data type]

Question 99. How Can We Know That A Session Is Started Or Not?

Answer :

A consultation starts by using session_start() function.

This session_start() is continually declared in header portion. It usually declares first. Then we write session_register().

Question a hundred. What Are The Differences Between Mysql_fetch_array(), Mysql_fetch_object(), Mysql_fetch_row()?

Answer :

mysql_fetch_array() -> Fetch a end result row as a mixture of associative array and ordinary array.

Mysql_fetch_object() -> Fetch a end result row as an object.

Mysql_fetch_row() -> Fetch a end result set as a regular array().

Question 101. If We Login More Than One Browser Windows At The Same Time With Same User And After That We Close One Window, Then Is The Session Is Exist To Other Windows Or Not? And If Yes Then Why? If No Then Why?

Answer :

Session depends on browser. If browser is closed then consultation is lost. The consultation information may be deleted after session day trip. If connection is lost and also you recreate connection, then session will keep inside the browser.

Question 102. What Are The Mysql Database Files Stored In System ?

Answer :

Data is saved in call.Myd

Table shape is saved in name.Frm

Index is saved in name.Myi

Question 103. What Is The Difference Between Php4 And Php5?

Answer :

PHP4 can not guide oops standards and Zend engine 1 is used.

PHP5 helps oops concepts and Zend engine 2 is used.

Error helping is increased in PHP5.

XML and SQLLite will is multiplied in PHP5.

Question 104. Can We Use Include(abc.Hypertext Preprocessor) Two Times In A Php Page Makeit.Php?

Answer :

Yes we are able to include that regularly we need, but right here are some things to ensure of:

(which includes abc.PHP, the document names are case-sensitive) there shouldn’t be any reproduction feature names, means there should not be functions or classes or variables with the identical call in abc.PHP and makeit.Hypertext Preprocessor.

Question one zero five. How Can We Encrypt And Decrypt A Data Presented In A Table Using Mysql?

Answer :

You can use capabilities: AES_ENCRYPT() and AES_DECRYPT() like:

AES_ENCRYPT(str, key_str)
AES_DECRYPT(crypt_str, key_str)

Question 106. How Can I Retrieve Values From One Database Server And Store Them In Other Database Server Using Php?

Answer :

For this purpose, you could first examine the statistics from one server into session variables. Then hook up with different server and in reality insert the data into the database.

Question 107. Who Is The Father Of Php And What Is The Current Version Of Php And Mysql?

Answer :

Rasmus Lerdorf.
PHP 5.1. Beta
MySQL five.0

Question 108. In How Many Ways We Can Retrieve Data In The Result Set Of Mysql Using Php?

Answer :

mysql_fetch_array – Fetch a result row as an associative array, a numeric array, or both
mysql_fetch_assoc – Fetch a end result row as an associative array
mysql_fetch_object – Fetch a result row as an item
mysql_fetch_row —- Get a end result row as an enumerated array

Question 109. What Are The Functions For Imap?

Answer :

imap_body – Read the message body
imap_check – Check current mailbox
imap_delete – Mark a message for deletion from modern-day mailbox
imap_mail – Send an e-mail message

Question a hundred and ten. What Are Encryption Functions In Php?

Answer :

CRYPT()
MD5()

Question 111. What Is The Difference Between Htmlentities() And Htmlspecialchars()?

Answer :

htmlspecialchars() – Convert some unique characters to HTML entities (Only the most widely used)
htmlentities() – Convert ALL unique characters to HTML entities

Question 112. How To Set Cookies?

Answer :

setcookie(’variable’,’price’,’time’);
variable – name of the cookie variable
cost – fee of the cookie variable
time – expiry time
Example: setcookie(’Test’,$i,time()+3600);
Test – cookie variable call
$i – fee of the variable ‘Test’
time()+3600 – denotes that the cookie will expire after an one hour

Question 113. How To Reset/destroy A Cookie?

Answer :

Reset a cookie with the aid of specifying expire time inside the past:
Example: setcookie(’Test’,$i,time()-3600); // already expired time
Reset a cookie by using specifying its call handiest Example: setcookie(’Test’);

Question 114. Tools Used For Drawing Er Diagrams.

Answer :

Case Studio
Smart Draw

Question 115. How Can We Submit From Without A Submit Button?

Answer :

Trigger the JavaScript code on any occasion ( like onSelect of dropdown listbox, onfocus, and so on )
record.Myform.Submit(); This will publish the shape.

Question 116. What Are The Current Versions Of Apache, Php, And Mysql?

Answer :

PHP: PHP 5.1.2
MySQL: MySQL 5.1
Apache: Apache 2.1

Question 117. What Are The Features And Advantages Of Object Oriented Programming?

Answer :

One of the principle benefits of programming is its ease of amendment; items can without difficulty be changed and brought to a device there by using reducing upkeep costs.

Programming is likewise taken into consideration to be higher at modeling the real world this is procedural programming. It permits for more complicated and flexible interactions.

Structures also are less difficult for non-technical personnel to apprehend and less difficult for them to take part in the preservation and enhancement of a system as it appeals to natural human cognition styles. For a few systems, an technique can velocity development time due to the fact that many items are standard across structures and may be reused. Components that control dates, shipping, buying carts, etc. Can be bought and effortlessly changed for a particular machine.

Question 118. How Can I Make A Script That Can Be Bilingual (helps English, German)?

Answer :

You can exchange charset variable in above line within the script to assist bi-language.

Question 119. What's The Difference Between Accessing A Class Method Via -> And Via ::?

Answer :

:: is authorized to get admission to methods that could carry out static operations, i.E. The ones, which do no longer require item initialization.

Question 120. How Can Increase The Performance Of Mysql Select Query?

Answer :

We can use LIMIT to prevent MySql for in addition seek in table after we've acquired our required no. Of records, additionally we are able to use LEFT JOIN or RIGHT JOIN instead of full be a part of in instances we've related information in  or extra tables.

Question 121. When You Want To Show Some Part Of A Text Displayed On An Html Page In Red Font Color? What Different Possibilities Are There To Do This? What Are The Advantages /risks Of These Methods?

Answer :

There are 2 approaches to reveal some part of a text in pink:

Using HTML tag <font color=”red”>
Using HTML tag <span style=”color: red”>
Question 122. What Are The Different Ways To Login To A Remote Server? Explain The Means, Advantages And Disadvantages?

Answer :

There is as a minimum 3 approaches to logon to a remote server:

Use ssh or telnet in case you subject with protection
You can also use rlogin to logon to a far flung server.

Question 123. Please Give A Regular Expression (ideally Perl/preg Style), Which Can Be Used To Identify The Url From Within A Html Link Tag.

Answer :

Try this: /href=”([^"]*)”/i

Question 124. How Many Ways We Can Give The Output To A Browser?

Answer :

HTML output
PHP, ASP, JSP, Servlet Function
Script Language output Function
Different Type of embedded Package to output to a browser

Question 125. What Is The Default Session Time In Php And How Can I Change It?

Answer :

The default session time in personal home page is until ultimate of browser

Question 126. What Changes I Have To Do In Php.Ini File For File Uploading?

Answer :

Make the following line uncomment like:

; Whether to allow HTTP file uploads.
File_uploads = On

; Temporary listing for HTTP uploaded files (will use gadget default if now not certain).
Upload_tmp_dir = C:apache2triadtemp

; Maximum allowed length for uploaded files.
Upload_max_filesize = 2M

Question 127. Steps For The Payment Gateway Processing?

Answer :

An on-line charge gateway is the interface among your merchant account and your Web web page. The on-line fee gateway allows you to right away affirm credit card transactions and authorize price range on a purchaser’s credit score card at once from your Web website online. It then passes the transaction off to your merchant financial institution for processing, normally known as transaction batching

Question 128. How Many Ways I Can Redirect A Php Page?

Answer :

Here are the feasible ways of php web page redirection.

Using Java script:
‘; echo ‘window.Area.Href=”‘.$filename.’”;’; echo ”; echo ”; echo ”; echo ”;   redirect(’http://wisdomjobs.Com’); ?>
Using php feature: header(”Location:http://wisdomjobs.Com “);
Question 129. List Out Different Arguments In Php Header Function?

Answer :

void header ( string string [, bool update [, int http _ response _ code]])

Question one hundred thirty. What Type Of Headers Have To Be Added In The Mail Function To Attach A File?

Answer :

$boundary = ‘–’ .Md5(uniqid(rand()));
$headers = “From: ”Me”n”;
$headers .= “MIME-Version: 1.0n”;
$headers .= “Content-Type: multipart/mixed;
boundary=”$boundary””;
Question 131. What Is The Difference Between Reply-to And Return-direction In The Headers Of A Mail Function?

Answer :

Reply-to: Reply-to is where to transport the reply of the mail.

Return-direction: Return route is whilst there is a mail transport failure takes place then in which to shipping the failure notification.

Question 132. How To Turn On The Session Support?

Answer :

The session aid can be became on routinely at the web site level, or manually in every PHP web page script:

Turning on consultation guide routinely on the web site level: Set session.Auto_start = 1 in php.Ini.
Turning on consultation aid manually in each web page script: Call session_start() function.
Question 133. Explain The Ternary Conditional Operator In Php?

Answer :

Expression previous the ? Is evaluated, if it’s proper, then the expression previous the : is executed, in any other case, the expression following : is performed.

Question 134. What's The Difference Between Include And Require?

Answer :

It’s how they cope with failures. If the document is not located via require(), it's going to cause a fatal errors and halt the execution of the script. If the record isn't always observed by means of encompass(), a caution can be issued, however execution will keep.

Question a hundred thirty five. How To Read The Entire File Into A Single String?

Answer :

If you have got a record, and also you want to read the entire record right into a single string, you can use the file_get_contents() function. It opens the desired report, reads all characters in the record, and returns them in a unmarried string. Here is a PHP script example on the way to file_get_contents():

<?Php
$file = file_get_contents(”/windows/system32/drivers/etc/services”);
print(”Size of the file: “.Strlen($file).”n”);
?>

This script will print:
Size of the record: 7116




CFG