<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4298559868793267373</id><updated>2011-11-27T15:18:35.741-08:00</updated><category term='Tech'/><category term='.Net interview questions'/><category term='Php interview Questions'/><category term='Java interview questions'/><title type='text'>php java .net - Your search ends here....!</title><subtitle type='html'>This blog will give more information about php, java, .net. it contains basic stuff and also some expertised stuff which breaks your mind for long days..! It also contains questions and answers of php, java, .net for interview preparation.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>venke</name><uri>http://www.blogger.com/profile/14427432237996405340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>22</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-1027820568375505313</id><published>2008-04-14T23:54:00.000-07:00</published><updated>2008-04-15T00:03:08.971-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java interview questions'/><title type='text'>JavaScript Interview Questions</title><content type='html'>&lt;span style="font-weight: bold;"&gt;What’s relationship between JavaScript and ECMAScript?&lt;/span&gt;&lt;br /&gt;ECMAScript is yet another name for JavaScript (other names include LiveScript). The current JavaScript that you see supported in browsers is ECMAScript revision 3.&lt;br /&gt;    &lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What are JavaScript types? &lt;/span&gt;&lt;br /&gt; Number, String, Boolean, Function, Object, Null, Undefined.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How do you convert numbers between different bases in JavaScript?&lt;/span&gt;&lt;br /&gt;Use the parseInt() function, that takes a string as the first parameter, and the base as a second parameter. So to convert hexadecimal 3F to decimal, use parseInt ("3F", 16);&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What does isNaN function do?&lt;/span&gt; &lt;br /&gt;Return true if the argument is not a number.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What is negative infinity? &lt;/span&gt;&lt;br /&gt;It’s a number in JavaScript, derived by dividing negative number by zero.&lt;br /&gt;&lt;br /&gt;   &lt;span style="font-weight: bold;"&gt;What boolean operators does JavaScript support?&lt;/span&gt;&lt;br /&gt;&amp;amp;&amp;amp;, and !&lt;br /&gt;  &lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What does "1"+2+4 evaluate to?&lt;/span&gt;&lt;br /&gt;Since 1 is a string, everything is a string, so the result is 124.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How about 2+5+"8"?&lt;/span&gt;&lt;br /&gt;Since 2 and 5 are integers, this is number arithmetic, since 8 is a string, it’s concatenation, so 78 is the result.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What looping structures are there in JavaScript?&lt;/span&gt;&lt;br /&gt; for, while, do-while loops, but no foreach.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;How do you create a new object in JavaScript?&lt;/span&gt;&lt;br /&gt; var obj = new Object(); or var obj = {};&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;How do you assign object properties?&lt;/span&gt;&lt;br /&gt; obj["age"] = 17 or obj.age = 17.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What’s a way to append a value to an array?&lt;/span&gt;&lt;br /&gt; arr[arr.length] = value;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What is this keyword?&lt;/span&gt;&lt;br /&gt;It refers to the current object.&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-1027820568375505313?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/1027820568375505313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=1027820568375505313' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/1027820568375505313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/1027820568375505313'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/javascript-interview-questions.html' title='JavaScript Interview Questions'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-8966738348903457380</id><published>2008-04-14T23:53:00.001-07:00</published><updated>2008-04-14T23:54:15.573-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net interview questions'/><title type='text'>ASP.Net interview questions</title><content type='html'>&lt;strong&gt;How many languages .NET is supporting now?&lt;/strong&gt; - When .NET was introduced it came with several languages. VB.NET, C#, COBOL and Perl, etc. The site DotNetLanguages.Net &lt;a href="http://www.dotnetlanguages.net/DNL/Resources.aspx"&gt;says 44 languages are supported&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How is .NET able to support multiple languages? &lt;/strong&gt;- a language should comply with the Common Language Runtime standard to become a .NET language. In .NET, code is compiled to Microsoft Intermediate Language (MSIL for short). This is called as Managed Code. This Managed code is run in .NET environment. So after compilation to this IL the language is not a barrier. A code can call or use a function written in another language.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How ASP .NET different from ASP?&lt;/strong&gt; - Scripting is separated from the HTML, Code is compiled as a DLL, these DLLs can be executed on the server.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Resource Files: How to use the resource files, how to know which language to use?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is smart navigation?&lt;/strong&gt; - The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is view state?&lt;/strong&gt; - The web is stateless. But in ASP.NET, the state of a page is maintained in the in the page itself automatically. How? The values are encrypted and saved in hidden controls. this is done automatically by the ASP.NET. This can be switched off / on for a single control&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Explain the life cycle of an ASP .NET page.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How do you validate the controls in an ASP .NET page?&lt;/strong&gt; - Using special validation controls that are meant for this. We have Range Validator, Email Validator.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Can the validation be done in the server side? Or this can be done only in the Client side?&lt;/strong&gt; - Client side is done by default. Server side validation is also possible. We can switch off the client side and server side can be done.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How to manage pagination in a page?&lt;/strong&gt; - Using pagination option in DataGrid control. We have to set the number of records for a page, then it takes care of pagination by itself.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is ADO .NET and what is difference between ADO and ADO.NET?&lt;/strong&gt; - ADO.NET is stateless mechanism. I can treat the ADO.Net as a separate in-memory database where in I can use relationships between the tables and select insert and updates to the database. I can update the actual database as a batch.&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-8966738348903457380?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/8966738348903457380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=8966738348903457380' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/8966738348903457380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/8966738348903457380'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/aspnet-interview-questions_14.html' title='ASP.Net interview questions'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-1580888516994152282</id><published>2008-04-14T23:48:00.000-07:00</published><updated>2008-04-14T23:52:48.663-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net interview questions'/><title type='text'>C# Interview Questions</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Can you explain what inheritance is and an example of when you might use it?&lt;/span&gt;&lt;br /&gt;Inheritance allows us to extend the functionality of a base class. It is an "Is a"&lt;br /&gt;     type of relationship rather than a "Uses" type of relationship (a dalmation IS A&lt;br /&gt;     dog which IS A canine which IS A mammal - dalmations inherist from dog which&lt;br /&gt;     inherits from canine which inherits from mammal). All child classes retain the&lt;br /&gt;     properties and methods of their parent classes but may override them. When you&lt;br /&gt;     want to inherit (use the functionality of) another class. Base Class Employee.&lt;br /&gt;     A Manager class could be derived from the Employee base class.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Does C# support multiple-inheritance?&lt;/span&gt;&lt;br /&gt;No, use interfaces instead.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Can you prevent your class from being inherited by another class?&lt;/span&gt;&lt;br /&gt; Yes.  The keyword “sealed” will prevent the class from being inherited.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What does the keyword “virtual” declare for a method or property?&lt;/span&gt;&lt;br /&gt; The method or property can be overridden.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What's the top .NET class that everything is derived from?&lt;/span&gt;&lt;br /&gt;System.Object.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What does it mean that a String is immutable?&lt;/span&gt;&lt;br /&gt; Strings cannot be altered. When you alter a string (by adding to it for example),&lt;br /&gt;     you are actually creating a new string.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;I have to alter a string many times, such as mutliple concatenations,what class should I use?&lt;/span&gt;&lt;br /&gt; StringBuilder. It is not immutable and is very efficient.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;In a Try - Catch - Finally block, will the finally block execute if an exception&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;      has not occurred? If an Exception has occurred?&lt;/span&gt;&lt;br /&gt; Yes and yes.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Whats MSIL, and why should developers need an appreciation of it, if at all?&lt;/span&gt;&lt;br /&gt;A. MSIL is the Microsoft Intermediate Language. All .NET compatible&lt;br /&gt;      languages will get converted to MSIL.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Explain the three tier or n-Tier model.&lt;/span&gt;&lt;br /&gt; Presentation (UI), business (logic and underlying code) and data&lt;br /&gt;     (from storage or other sources).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What is SOA?&lt;/span&gt;&lt;br /&gt;Service Oriented Architecture. In SOA you create an abstract layer that&lt;br /&gt;     your applications use to access various "services" and can aggregate the&lt;br /&gt;     services. These services could be databases, web services, message queues&lt;br /&gt;     or other sources. The Service Layer provides a way to access these services&lt;br /&gt;     that the applications do not need to know how the access is done. For example,&lt;br /&gt;     to get a full customer record, I might need to get data from a SGL Server&lt;br /&gt;     database, a web service and a message queue. The Service layer hides this from&lt;br /&gt;     the calling application. All the application knows is that it asked for a full&lt;br /&gt;     customer record. It doesn't know what system or systems it came from or&lt;br /&gt;      how it was retrieved.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What is the role of the Data Reader class in ADO.NET connections?&lt;/span&gt;&lt;br /&gt; It returns a forward-only, read-only view of data from the data source when&lt;br /&gt;     the command is executed.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Is XML case-sensitive?&lt;/span&gt;&lt;br /&gt;Yes.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What is the CLR?&lt;/span&gt;&lt;br /&gt;Common Language Runtime&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Can you explain some differences between an ADO.NET Dataset and&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;      an ADO Recordset? (Or describe some features of a Dataset).&lt;/span&gt;&lt;br /&gt;A DataSet can represent an entire relational database in memory,&lt;br /&gt;    complete with tables, relations, and views.  A DataSet is designed to&lt;br /&gt;    work without any continuing connection to the original data source.  Data in&lt;br /&gt;    a DataSet is bulk-loaded, rather than being loaded on demand.  There's no&lt;br /&gt;    concept of cursor types in a DataSet.  DataSets have no current record pointer&lt;br /&gt;    You can use For Each loops to move through the data.  You can store many&lt;br /&gt;    edits in a DataSet, and write them to the original data source in a single operation.&lt;br /&gt;    Though the DataSet is universal, other objects in ADO.NET come in different&lt;br /&gt;    versions for different data sources&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Name some of the Microsoft Application Blocks. Have you used any?&lt;/span&gt;&lt;br /&gt;     &lt;span style="font-weight: bold;"&gt;Which ones?&lt;/span&gt;&lt;br /&gt; Examples:&lt;br /&gt;     Exception Management&lt;br /&gt;     Logging&lt;br /&gt;     Data Access&lt;br /&gt;     User Interface&lt;br /&gt;     Caching Application Block for .NET&lt;br /&gt;     Asynchronous Invocation Application Block for .NET&lt;br /&gt;     Configuration Management Application Block for .NET&lt;br /&gt;     (there are others) We use Exception and Data Access&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-1580888516994152282?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/1580888516994152282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=1580888516994152282' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/1580888516994152282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/1580888516994152282'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/c-interview-questions.html' title='C# Interview Questions'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-3089501849223732255</id><published>2008-04-14T23:46:00.001-07:00</published><updated>2008-04-14T23:48:40.986-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net interview questions'/><title type='text'>Asp.Net Interview Questions</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Explain the differences between Server-side and Client-side code?&lt;/span&gt;&lt;br /&gt; Server-side code executes on the server. Client-side code executes in&lt;br /&gt;     the context of the clients' browser.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What are some ways to manage state in an ASP.Net application?&lt;/span&gt;&lt;br /&gt; Session objects, Application objects, ViewState, cookies, hidden form fields.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What does the "EnableViewState" property do? Why would I want it on or off?&lt;/span&gt;&lt;br /&gt; It allows page objects to save their state in a Base64 encoded string in the page&lt;br /&gt;     HTML. One should only have it enabled when needed because it adds to the&lt;br /&gt;     page size and can get fairly large for complex pages with many controls.&lt;br /&gt;    (It takes longer to download the page).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What is the difference between Server.Transfer and Response.Redirect? Why&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;      would I choose one over the other?&lt;/span&gt;&lt;br /&gt;   Server.Transfer transfers excution directly to another page. Response.Redirect&lt;br /&gt;     sends a response to the client and directs the client (the browser) to load the&lt;br /&gt;    new page (it causes a roundtrip). If you don't need to execute code on the client,&lt;br /&gt;     Transfer is more efficient.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How can I maintain Session state in a Web Farm or Web Garden?&lt;/span&gt;&lt;br /&gt;Use a State Server or SQL Server to store the session state.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;base class do all Web Forms inherit from?&lt;/span&gt;&lt;br /&gt; The Page class.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What does WSDL stand for? What does it do?&lt;/span&gt;&lt;br /&gt;(Web Services Description Language). It describes the interfaces and&lt;br /&gt;     other information of a web service.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Which  WebForm Validator control would you use if you needed to make&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;      sure the values in two different WebForm controls matched?&lt;/span&gt;&lt;br /&gt; CompareValidator Control&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What property must you set, and what method must you call in your code,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;      in order to bind the data from some data source to the Repeater control?&lt;/span&gt;&lt;br /&gt; You must set the DataSource property and call the DataBind method.&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-3089501849223732255?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/3089501849223732255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=3089501849223732255' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/3089501849223732255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/3089501849223732255'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/aspnet-interview-questions.html' title='Asp.Net Interview Questions'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-628908016254612322</id><published>2008-04-14T23:45:00.001-07:00</published><updated>2008-04-14T23:45:37.905-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Php interview Questions'/><title type='text'>Php interview Questions - part15</title><content type='html'>&lt;p&gt;&lt;b&gt;How many ways we can give the output to a browser? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;HTML output&lt;br /&gt;PHP, ASP, JSP, &lt;span class="SpellE"&gt;Servlet&lt;/span&gt; Function&lt;br /&gt;Script Language output Function&lt;br /&gt;Different Type of embedded Package to output to a browser &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What is the default session time in &lt;span class="SpellE"&gt;php&lt;/span&gt; and how can I change it? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The default session time in &lt;span class="SpellE"&gt;php&lt;/span&gt; is until closing of browser &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What changes I have to do in php.ini file for file uploading? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Make the following line uncomment like&lt;span class="GramE"&gt;:&lt;br /&gt;;&lt;/span&gt; Whether to allow HTTP file uploads.&lt;br /&gt;&lt;span class="SpellE"&gt;file_uploads&lt;/span&gt; = On&lt;br /&gt;; Temporary directory for HTTP uploaded files (will use system default if not&lt;br /&gt;; specified).&lt;br /&gt;&lt;span class="SpellE"&gt;upload_tmp_dir&lt;/span&gt; = C:\apache2triad\temp&lt;br /&gt;; Maximum allowed size for uploaded files.&lt;br /&gt;&lt;span class="SpellE"&gt;upload_max_filesize&lt;/span&gt; = 2M&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can I set a &lt;span class="SpellE"&gt;cron&lt;/span&gt; and how can I execute it in &lt;span class="GramE"&gt;Unix&lt;/span&gt;, Linux, and windows? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;Cron&lt;/span&gt; is very simply a Linux module that allows you to run commands at predetermined times or intervals. In Windows, it's called Scheduled Tasks. The name &lt;span class="SpellE"&gt;Cron&lt;/span&gt; is in fact derived from the same word from which we get the word chronology, which means order of time.&lt;br /&gt;The easiest way to use &lt;span class="SpellE"&gt;crontab&lt;/span&gt; is via the &lt;span class="SpellE"&gt;crontab&lt;/span&gt; command.&lt;br /&gt;&lt;br /&gt;# &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;crontab&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This command 'edits' the &lt;span class="SpellE"&gt;crontab&lt;/span&gt;. Upon employing this command, you will be able to enter the commands that you wish to run. My version of&lt;br /&gt;Linux uses the text editor &lt;span class="GramE"&gt;vi&lt;/span&gt;. You can find information on using &lt;span class="GramE"&gt;vi&lt;/span&gt; here.&lt;br /&gt;&lt;br /&gt;The syntax of this file is very important – if you get it wrong, your &lt;span class="SpellE"&gt;crontab&lt;/span&gt; will not function properly. The syntax of the file should be as follows&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;minutes hours &lt;span class="SpellE"&gt;day_of_month&lt;/span&gt; month &lt;span class="SpellE"&gt;day_of_week&lt;/span&gt; command&lt;br /&gt;&lt;br /&gt;All the variables, with the exception of the command itself, are numerical constants. In addition to an asterisk (*), which is a wildcard that allows any value, the ranges permitted for each field are as follows&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Minutes: 0-59&lt;br /&gt;Hours: 0-23&lt;br /&gt;&lt;span class="SpellE"&gt;Day_of_month&lt;/span&gt;: 1-31&lt;br /&gt;Month: 1-12&lt;br /&gt;Weekday: 0-6&lt;br /&gt;&lt;br /&gt;We can also include multiple values for each entry, simply by separating each value with a comma.&lt;br /&gt;&lt;span class="GramE"&gt;command&lt;/span&gt; can be any shell command and, as we will see momentarily, can also be used to execute a Web document such as a PHP file.&lt;br /&gt;So, if we want to run a script every Tuesday morning at 8:15 AM, our &lt;span class="SpellE"&gt;mycronjob&lt;/span&gt; file will contain the following content on a single line:&lt;br /&gt;&lt;br /&gt;15 8 * * 2 /path/to/&lt;span class="SpellE"&gt;scriptname&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This all seems simple enough, right? Not so fast! If you try to run a PHP script in this manner, nothing will happen (barring very special configurations that have PHP compiled as an executable, as opposed to an Apache module). The reason is that, in order for PHP to be parsed, it needs to be passed through Apache. In other words, the page needs to be called via a browser or other means of retrieving&lt;br /&gt;&lt;br /&gt;Web content. For our purposes, I'll assume that your server configuration includes &lt;span class="SpellE"&gt;wget&lt;/span&gt;, as is the case with most default configurations. To test your configuration, log in to shell. If you're using an RPM-based system (e.g. &lt;span class="SpellE"&gt;Redhat&lt;/span&gt; or Mandrake), type the following&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;# &lt;span class="SpellE"&gt;wget&lt;/span&gt; help&lt;br /&gt;&lt;br /&gt;If you are greeted with a &lt;span class="SpellE"&gt;wget&lt;/span&gt; package identification, it is installed in your system.&lt;br /&gt;You could execute the PHP by invoking &lt;span class="SpellE"&gt;wget&lt;/span&gt; on the URL to the page, like so&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;# &lt;span class="SpellE"&gt;wget&lt;/span&gt; http://www.example.com/file.php&lt;br /&gt;&lt;br /&gt;Now, let's go back to the &lt;span class="SpellE"&gt;mailstock.php&lt;/span&gt; file we created in the first part of this article. We saved it in our document root, so it should be accessible via the Internet. Remember that we wanted it to run at  4PM Eastern time, and send you your precious closing bell report? Since I'm located in the Eastern &lt;span class="SpellE"&gt;timezone&lt;/span&gt;, we can go ahead and set up our &lt;span class="SpellE"&gt;crontab&lt;/span&gt; to use  4:00 , but if you live elsewhere, you might have to compensate for the time difference when setting this value.&lt;br /&gt;This is what my &lt;span class="SpellE"&gt;crontab&lt;/span&gt; will look like&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;0 4 * * 1,2,3,4,5 &lt;span class="SpellE"&gt;wget&lt;/span&gt; http://www.example.com/mailstock.php &lt;/p&gt;  &lt;p&gt;&lt;span class="GramE"&gt;&lt;b&gt;Steps for the payment gateway processing?&lt;/b&gt;&lt;/span&gt;&lt;b&gt; &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;An online payment gateway is the interface between your merchant account and your Web site. The online payment gateway allows you to immediately verify credit card transactions and authorize funds on a customer's credit card directly from your Web site. It then passes the transaction off to your merchant bank for processing, commonly referred to as transaction batching &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How many ways I can redirect a PHP page? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Here are the possible ways of &lt;span class="SpellE"&gt;php&lt;/span&gt; page redirection.&lt;br /&gt;&lt;br /&gt;1. Using Java script:&lt;br /&gt;&lt;span class="GramE"&gt;';&lt;/span&gt; echo '&lt;span class="SpellE"&gt;window.location.href&lt;/span&gt;="'.$filename.'";'; echo ''; echo ''; echo ''; echo ''; } } redirect('http://maosjb.com'); ?&gt;&lt;br /&gt;&lt;br /&gt;2. Using &lt;span class="SpellE"&gt;php&lt;/span&gt; function: &lt;span class="GramE"&gt;header(&lt;/span&gt;"Location:http://maosjb.com "); &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;List out different arguments in PHP header function? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="GramE"&gt;void&lt;/span&gt; header ( string &lt;span class="SpellE"&gt;string&lt;/span&gt; [, &lt;span class="SpellE"&gt;bool&lt;/span&gt; replace [, &lt;span class="SpellE"&gt;int&lt;/span&gt; &lt;span class="SpellE"&gt;http_response_code&lt;/span&gt;]]) &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What &lt;span class="GramE"&gt;type of headers have&lt;/span&gt; to be added in the mail function to attach a file? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;$boundary = '--&lt;span class="GramE"&gt;' .&lt;/span&gt; md5( &lt;span class="SpellE"&gt;uniqid&lt;/span&gt; ( rand() ) );&lt;br /&gt;$headers = "From: \"Me\"\n";&lt;br /&gt;$headers .= "MIME-Version: 1.0\n";&lt;br /&gt;$headers .= "Content-Type: multipart/mixed; boundary=\"$boundary\"";&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How to store the uploaded file to the final location? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;move_uploaded_file&lt;/span&gt; &lt;span class="GramE"&gt;( string&lt;/span&gt; filename, string destination)&lt;br /&gt;&lt;br /&gt;This function checks to ensure that the file designated by filename is a valid upload file (meaning that it was uploaded via &lt;span class="SpellE"&gt;PHP's&lt;/span&gt; HTTP POST upload mechanism). If the file is valid, it will be moved to the filename given by destination.&lt;br /&gt;&lt;br /&gt;If filename is not a valid upload file, then no action will occur, and &lt;span class="SpellE"&gt;move_uploaded_&lt;span class="GramE"&gt;file&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) will return FALSE.&lt;br /&gt;&lt;br /&gt;If filename is a valid upload file, but cannot be moved for some reason, no action will occur, and &lt;span class="SpellE"&gt;move_uploaded_&lt;span class="GramE"&gt;file&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) will return FALSE. Additionally, a warning will be issued. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What is the difference between Reply-to and Return-path in the headers of a mail function? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Reply-to: Reply-to is where to delivery the reply of the mail.&lt;br /&gt;&lt;br /&gt;Return-path: Return path is when there is a mail delivery failure occurs then where to delivery the failure notification. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;Explain about Type Juggling in &lt;span class="SpellE"&gt;php&lt;/span&gt;? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;PHP does not require (or support) explicit type definition in variable declaration; a variable's type is determined by the context in which that variable is used. That is to say, if you assign a string value to variable $&lt;span class="SpellE"&gt;var&lt;/span&gt;, $&lt;span class="SpellE"&gt;var&lt;/span&gt; becomes a string. If you then assign an integer value to $&lt;span class="SpellE"&gt;var&lt;/span&gt;, it becomes an integer.&lt;br /&gt;&lt;br /&gt;An example of &lt;span class="SpellE"&gt;PHP's&lt;/span&gt; automatic type conversion is the addition operator '+'. If any of the operands is a float, then all operands are evaluated as floats, and the result will be a float. Otherwise, the operands will be interpreted as integers, and the result will also be an integer. Note that this does NOT change the types of the operands themselves; the only change is in how the operands are evaluated.&lt;br /&gt;&lt;br /&gt;$&lt;span class="SpellE"&gt;foo&lt;/span&gt; += 2; // $&lt;span class="SpellE"&gt;foo&lt;/span&gt; is now an integer (2&lt;span class="GramE"&gt;)&lt;/span&gt;&lt;br /&gt;$&lt;span class="SpellE"&gt;foo&lt;/span&gt; = $&lt;span class="SpellE"&gt;foo&lt;/span&gt; + 1.3; // $&lt;span class="SpellE"&gt;foo&lt;/span&gt; is now a float (3.3)&lt;br /&gt;$&lt;span class="SpellE"&gt;foo&lt;/span&gt; = 5 + "10 Little &lt;span class="SpellE"&gt;Piggies&lt;/span&gt;"; // $&lt;span class="SpellE"&gt;foo&lt;/span&gt; is integer (15)&lt;br /&gt;$&lt;span class="SpellE"&gt;foo&lt;/span&gt; = 5 + "10 Small Pigs"; // $&lt;span class="SpellE"&gt;foo&lt;/span&gt; is integer (15)&lt;br /&gt;&lt;br /&gt;If the last two examples above seem odd, see String conversion to numbers.&lt;br /&gt;If you wish to change the type of a variable, see &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;settype&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;).&lt;br /&gt;If you would like to test any of the examples in this section, you can use the &lt;span class="SpellE"&gt;var_&lt;span class="GramE"&gt;dump&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) function.&lt;br /&gt;Note: The behavior of an automatic conversion to array is currently undefined.&lt;br /&gt;&lt;br /&gt;Since PHP (for historical reasons) supports indexing into strings via offsets using the same syntax as array indexing, the example above leads to a problem: should $&lt;span class="GramE"&gt;a become&lt;/span&gt; an array with its first element being "f", or should "f" become the first character of the string $a? The current versions of PHP interpret the second assignment as a string offset identification, so $&lt;span class="GramE"&gt;a becomes&lt;/span&gt; "f", the result of this automatic conversion however should be considered undefined. PHP 4 introduced the new curly bracket syntax to access characters in string, use this syntax instead of the one presented above: &lt;/p&gt;  &lt;p&gt;&lt;b&gt;How can I embed a java &lt;span class="SpellE"&gt;programme&lt;/span&gt; in &lt;span class="SpellE"&gt;php&lt;/span&gt; file and what changes have to be done in php.ini file? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;There are two possible ways to bridge PHP and Java: you can either integrate PHP into a Java &lt;span class="SpellE"&gt;Servlet&lt;/span&gt; environment, which is the more stable and efficient solution, or integrate Java support into PHP. The former is provided by a SAPI module that interfaces with the &lt;span class="SpellE"&gt;Servlet&lt;/span&gt; server, the latter by this Java extension.&lt;br /&gt;The Java extension provides a simple and effective means for creating and invoking methods on Java objects from PHP. The JVM is created using JNI, and everything runs in-process.&lt;br /&gt;&lt;br /&gt;Example Code:&lt;br /&gt;&lt;br /&gt;&lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;getProperty&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;'&lt;span class="SpellE"&gt;java.version&lt;/span&gt;') . ''; echo 'Java vendor=&lt;span class="GramE"&gt;' .&lt;/span&gt; $system-&gt;&lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;getProperty&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;'&lt;span class="SpellE"&gt;java.vendor&lt;/span&gt;') . ''; echo 'OS=&lt;span class="GramE"&gt;' .&lt;/span&gt; $system-&gt;&lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;getProperty&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;'&lt;span class="SpellE"&gt;os.name&lt;/span&gt;') . ' &lt;span class="SpellE"&gt;'&lt;/span&gt; . $system-&gt;&lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;getProperty&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;'&lt;span class="SpellE"&gt;os.version&lt;/span&gt;') . &lt;span class="GramE"&gt;' on&lt;/span&gt; ' . $system-&gt;&lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;getProperty&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;'&lt;span class="SpellE"&gt;os.arch&lt;/span&gt;') . &lt;span class="GramE"&gt;' &lt;span class="SpellE"&gt;'&lt;/span&gt;&lt;/span&gt;; // &lt;span class="SpellE"&gt;java.util.Date&lt;/span&gt; example $formatter = new Java('&lt;span class="SpellE"&gt;java.text.SimpleDateFormat&lt;/span&gt;', "EEEE, MMMM &lt;span class="SpellE"&gt;dd&lt;/span&gt;, &lt;span class="SpellE"&gt;yyyy&lt;/span&gt; 'at' &lt;span class="SpellE"&gt;h:mm:ss&lt;/span&gt; a zzzz"); echo $formatter-&gt;format(new Java('&lt;span class="SpellE"&gt;java.util.Date&lt;/span&gt;')); ?&gt;&lt;br /&gt;&lt;br /&gt;The &lt;span class="SpellE"&gt;behaviour&lt;/span&gt; of these functions is affected by settings in php.ini.&lt;br /&gt;&lt;span class="GramE"&gt;Table 1.&lt;/span&gt; Java configuration options&lt;br /&gt;Name&lt;br /&gt;Default&lt;br /&gt;Changeable&lt;br /&gt;&lt;span class="SpellE"&gt;java.class.path&lt;/span&gt;&lt;br /&gt;NULL&lt;br /&gt;PHP_INI_ALL&lt;br /&gt;Name Default Changeable&lt;br /&gt;&lt;span class="SpellE"&gt;java.home&lt;/span&gt;&lt;br /&gt;NULL&lt;br /&gt;PHP_INI_ALL&lt;br /&gt;&lt;span class="SpellE"&gt;java.library.path&lt;/span&gt;&lt;br /&gt;NULL&lt;br /&gt;PHP_INI_ALL&lt;br /&gt;&lt;span class="SpellE"&gt;java.library&lt;/span&gt;&lt;br /&gt;JAVALIB&lt;br /&gt;PHP_INI_ALL &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How &lt;span class="GramE"&gt;To&lt;/span&gt; Turn On the Session Support? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The session support can be turned on automatically at the site level, or manually in each PHP page script:&lt;/p&gt;  &lt;ul type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;Turning on session support      automatically at the site level: Set &lt;span class="SpellE"&gt;session.auto_start&lt;/span&gt;      = 1 in php.ini.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Turning on session support      manually in each page script: Call &lt;span class="SpellE"&gt;session_&lt;span class="GramE"&gt;start&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) &lt;span class="SpellE"&gt;funtion&lt;/span&gt;.&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;Explain the ternary conditional operator in PHP? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Expression preceding &lt;span class="GramE"&gt;the ?&lt;/span&gt; &lt;span class="GramE"&gt;is&lt;/span&gt; evaluated, if it’s true, then the expression preceding the : is executed, otherwise, the expression following : is executed. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;span class="GramE"&gt;&lt;b&gt;What’s the difference&lt;/b&gt;&lt;/span&gt;&lt;b&gt; between include and require? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;It’s how they handle failures. If the file is not found by &lt;span class="GramE"&gt;require(&lt;/span&gt;), it will cause a fatal error and halt the execution of the script. If the file is not found by &lt;span class="GramE"&gt;include(&lt;/span&gt;), a warning will be issued, but execution will continue. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How many ways can we get the value of current session id? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;session_&lt;span class="GramE"&gt;id&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) returns the session id for the current session. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;How can we destroy the cookie? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Set the cookie in past. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How &lt;span class="GramE"&gt;To&lt;/span&gt; Read the Entire File into a Single String? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;If you have a file, and you want to read the entire file into a single string, you can use the &lt;span class="SpellE"&gt;file_get_&lt;span class="GramE"&gt;contents&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) function. It opens the specified file, reads all characters in the file, and returns them in a single string. Here is a PHP script example on how to &lt;span class="SpellE"&gt;file_get_&lt;span class="GramE"&gt;contents&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;):&lt;br /&gt;&lt;br /&gt;&lt;?&lt;span class="SpellE"&gt;php&lt;/span&gt;&lt;br /&gt;$file = &lt;span class="SpellE"&gt;file_get_contents&lt;/span&gt;("/windows/system32/drivers/etc/services");&lt;br /&gt;print("Size of the file: ".&lt;span class="SpellE"&gt;strlen&lt;/span&gt;($file)."\n"&lt;span class="GramE"&gt;);&lt;br /&gt;?&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This script will print:&lt;br /&gt;&lt;br /&gt;Size of the file: 7116 &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-628908016254612322?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/628908016254612322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=628908016254612322' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/628908016254612322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/628908016254612322'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/php-interview-questions-part15.html' title='Php interview Questions - part15'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-107183704440756424</id><published>2008-04-14T23:44:00.001-07:00</published><updated>2008-04-14T23:44:59.021-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Php interview Questions'/><title type='text'>Php interview Questions - part14</title><content type='html'>&lt;p&gt;&lt;b&gt;What is maximum size of a database in &lt;span class="SpellE"&gt;mysql&lt;/span&gt;? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;If the operating system or &lt;span class="SpellE"&gt;filesystem&lt;/span&gt; places a limit on the number of files in a directory, MySQL is bound by that constraint. The efficiency of the operating system in handling large numbers of files in a directory can place a practical limit on the number of tables in a database. If the time required &lt;span class="GramE"&gt;to open&lt;/span&gt; a file in the directory increases significantly as the number of files increases, database performance can be adversely affected.&lt;br /&gt;The amount of available disk space limits the number of tables.&lt;br /&gt;MySQL 3.22 had a 4GB (4 gigabyte) limit on table size. With the &lt;span class="SpellE"&gt;MyISAM&lt;/span&gt; storage engine in MySQL 3.23, the maximum table size was increased to 65536 terabytes (2567 – 1 bytes). With this larger allowed table size, the maximum effective table size for MySQL databases is usually determined by operating system constraints on file sizes, not by MySQL internal limits.&lt;br /&gt;The &lt;span class="SpellE"&gt;InnoDB&lt;/span&gt; storage engine maintains &lt;span class="SpellE"&gt;InnoDB&lt;/span&gt; tables within a &lt;span class="SpellE"&gt;tablespace&lt;/span&gt; that can be created from several files. This allows a table to exceed the maximum individual file size. The &lt;span class="SpellE"&gt;tablespace&lt;/span&gt; can include raw disk partitions, which allows extremely large tables. The maximum &lt;span class="SpellE"&gt;tablespace&lt;/span&gt; size is 64TB.&lt;br /&gt;The following table lists some examples of operating system file-size limits. This is only a rough guide and is not intended to be definitive. For the most up-to-date information, be sure to check the documentation specific to your operating system.&lt;br /&gt;Operating System File-size Limit&lt;br /&gt;Linux 2.2-Intel 32-bit 2GB (LFS: 4GB&lt;span class="GramE"&gt;)&lt;/span&gt;&lt;br /&gt;Linux 2.4+ (using ext3 &lt;span class="SpellE"&gt;filesystem&lt;/span&gt;) 4TB&lt;br /&gt;Solaris 9/10 16TB&lt;br /&gt;NetWare w/NSS &lt;span class="SpellE"&gt;filesystem&lt;/span&gt; 8TB&lt;br /&gt;Win32 w/ FAT/FAT32 2GB/4GB&lt;br /&gt;Win32 w/ NTFS 2TB (possibly larger)&lt;br /&gt;&lt;span class="SpellE"&gt;MacOS&lt;/span&gt; X w/ HFS+ 2TB&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;Explain normalization concept? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The normalization process involves getting our data to conform to three progressive normal forms, and a higher level of normalization cannot be achieved until the previous levels have been achieved (there are actually five normal forms, but the last two are mainly academic and will not be discussed).&lt;br /&gt;&lt;br /&gt;First Normal Form&lt;br /&gt;The First Normal Form (or 1NF) involves removal of redundant data from horizontal rows. We want to ensure that there is no duplication of data in a given row, and that every column stores the least amount of information possible (making the field atomic).&lt;br /&gt;&lt;br /&gt;Second Normal Form&lt;br /&gt;Where the First Normal Form deals with redundancy of data across a horizontal row, Second Normal Form (or 2NF) deals with redundancy of data in vertical columns. As stated earlier, the normal forms are progressive, so to achieve Second Normal Form, your tables must already be in First Normal Form.&lt;br /&gt;&lt;br /&gt;Third Normal Form&lt;br /&gt;I have a confession to make; I do not often use Third Normal Form. In Third Normal Form we are looking for data in our tables that is not fully dependant on the primary key, but dependant on another value in the table &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What’s the difference between accessing a class method via -&gt; and &lt;span class="GramE"&gt;via :&lt;/span&gt;:? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="GramE"&gt;::&lt;/span&gt; is allowed to access methods that can perform static operations, i.e. those, which do not require object initialization. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;What are the advantages and disadvantages of CASCADE STYLE SHEETS? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;External Style Sheets&lt;br /&gt;Advantages&lt;br /&gt;Can control styles for multiple documents at once Classes can be created for use on multiple HTML element types in many documents Selector and grouping methods can be used to apply styles under complex contexts&lt;br /&gt;&lt;br /&gt;Disadvantages&lt;br /&gt;An extra download is required to import style information for each document The rendering of the document may be delayed until the external style sheet is loaded Becomes slightly unwieldy for small quantities of style definitions&lt;br /&gt;&lt;br /&gt;Embedded Style Sheets&lt;br /&gt;Advantages&lt;br /&gt;Classes can be created for use on multiple tag types in the document Selector and grouping methods can be used to apply styles under complex contexts No additional downloads necessary to receive style information&lt;br /&gt;&lt;br /&gt;Disadvantage&lt;br /&gt;This method can not control styles for multiple documents at once&lt;br /&gt;&lt;br /&gt;Inline Styles&lt;br /&gt;Advantages&lt;br /&gt;Useful for small quantities of style definitions Can override other style specification methods at the local level so only exceptions need to be listed in conjunction with other style methods&lt;br /&gt;&lt;br /&gt;Disadvantages&lt;br /&gt;Does not distance style information from content (a main goal of SGML/HTML) Can not control styles for multiple documents at once Author can not create or control classes of elements to control multiple element types within the document Selector grouping methods can not be used to create complex element addressing scenarios &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;What type of inheritance that &lt;span class="SpellE"&gt;php&lt;/span&gt; supports? &lt;/p&gt;  &lt;p&gt;In PHP an extended class is always dependent on a single base class, that is, multiple inheritance is not supported. Classes are extended using the keyword 'extends'. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can increase the performance of MySQL select query? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;We can use LIMIT to stop &lt;span class="SpellE"&gt;MySql&lt;/span&gt; for further search in table after we have received our required no. of records, also we can use LEFT JOIN or RIGHT JOIN instead of full join in cases we have related data in two or more tables. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can we change the name of a column of a table? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;MySQL query to rename table: RENAME TABLE &lt;span class="SpellE"&gt;tbl_name&lt;/span&gt; TO &lt;span class="SpellE"&gt;new_tbl_name&lt;/span&gt;&lt;br /&gt;or&lt;span class="GramE"&gt;,&lt;/span&gt;&lt;br /&gt;ALTER TABLE &lt;span class="SpellE"&gt;tableName&lt;/span&gt; CHANGE &lt;span class="SpellE"&gt;OldName&lt;/span&gt; &lt;span class="SpellE"&gt;newName&lt;/span&gt;. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;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/disadvantages of these methods? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;There are 2 ways to show some part of a text in red&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. Using HTML tag &lt;span style="color:red;"&gt;&lt;br /&gt;2. Using HTML tag &lt;span style="color: red"&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;When viewing an HTML page in a Browser, the Browser often keeps this page in its cache. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;When you use the &lt;span class="SpellE"&gt;metatag&lt;/span&gt; in the header section at the beginning of an HTML Web page, the Web page may still be cached in the Temporary Internet Files folder.&lt;br /&gt;&lt;br /&gt;A page that Internet Explorer is browsing is not cached until half of the 64 KB buffer is filled. Usually, &lt;span class="SpellE"&gt;metatags&lt;/span&gt; are inserted in the header section of an HTML document, which appears at the beginning of the document. When the HTML code is parsed, it is read from top to bottom. When the &lt;span class="SpellE"&gt;metatag&lt;/span&gt; is read, Internet Explorer looks for the existence of the page in cache at that exact moment. If it is there, it is removed. To properly prevent the Web page from appearing in the cache, place another header section at the end of the HTML document. For example: &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What are the different ways to login to a remote server? Explain the means, advantages and disadvantages? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;There is at least 3 ways to logon to a remote server&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;Use &lt;span class="SpellE"&gt;ssh&lt;/span&gt; or telnet if you concern with security&lt;br /&gt;You can also use rlogin to logon to a remote server.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Please give a regular expression (preferably &lt;span class="SpellE"&gt;Perl&lt;/span&gt;/PREG style), which can be used to identify the URL from within a HTML link tag. &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Try this: /&lt;span class="SpellE"&gt;href&lt;/span&gt;="([^"]*)"/&lt;span class="SpellE"&gt;i&lt;/span&gt; &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can I use the COM components in &lt;span class="SpellE"&gt;php&lt;/span&gt;? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The COM class provides a framework to integrate (D&lt;span class="GramE"&gt;)COM&lt;/span&gt; components into your PHP scripts.&lt;br /&gt;&lt;span class="GramE"&gt;string&lt;/span&gt; COM::COM( string &lt;span class="SpellE"&gt;module_name&lt;/span&gt; [, string &lt;span class="SpellE"&gt;server_name&lt;/span&gt; [, &lt;span class="SpellE"&gt;int&lt;/span&gt; codepage]]) - COM class constructor.&lt;br /&gt;&lt;br /&gt;Parameters&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="SpellE"&gt;module_name&lt;/span&gt;: name or class-id of the requested component.&lt;br /&gt;&lt;span class="SpellE"&gt;server_name&lt;/span&gt;: name of the DCOM server from which the component should be fetched. &lt;span class="GramE"&gt;If NULL, &lt;span class="SpellE"&gt;localhost&lt;/span&gt; is assumed.&lt;/span&gt; To allow DCOM com, &lt;span class="SpellE"&gt;allow_dcom&lt;/span&gt; has to be set to TRUE in php.ini.&lt;br /&gt;&lt;span class="GramE"&gt;codepage&lt;/span&gt; - specifies the codepage that is used to convert &lt;span class="SpellE"&gt;php&lt;/span&gt;-strings to &lt;span class="SpellE"&gt;unicode&lt;/span&gt;-strings and vice versa. Possible values are CP_ACP, CP_MACCP, CP_OEMCP, CP_SYMBOL, CP_THREAD_ACP, CP_UTF7 and CP_UTF8.&lt;br /&gt;Usage&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;$word-&gt;Visible = 1; //open an empty document&lt;br /&gt;$word-&gt;Documents-&gt;Add(); //do some weird stuff&lt;br /&gt;$word-&gt;Selection-&gt;&lt;span class="SpellE"&gt;TypeText&lt;/span&gt;("This is a test…");&lt;br /&gt;$word-&gt;Documents[1]-&gt;&lt;span class="SpellE"&gt;SaveAs&lt;/span&gt;("Useless test.doc"); //closing word&lt;br /&gt;$word-&gt;Quit(); //free the object&lt;br /&gt;$word-&gt;Release();&lt;br /&gt;$word = null; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-107183704440756424?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/107183704440756424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=107183704440756424' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/107183704440756424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/107183704440756424'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/php-interview-questions-part14.html' title='Php interview Questions - part14'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-5817032257350185435</id><published>2008-04-14T23:43:00.000-07:00</published><updated>2008-04-14T23:44:15.734-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Php interview Questions'/><title type='text'>Php interview Questions - part13</title><content type='html'>&lt;p&gt;&lt;span class="GramE"&gt;&lt;b&gt;What are the features and advantages of OBJECT ORIENTED PROGRAMMING?&lt;/b&gt;&lt;/span&gt;&lt;b&gt; &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;One of the main advantages of OO programming is its ease of modification; objects can easily be modified and added to a system there by reducing maintenance costs. OO programming is also considered to be better at modeling the real world than is procedural programming. It allows for more complicated and flexible interactions. OO systems are also easier for non-technical personnel to understand and easier for them to participate in the maintenance and enhancement of a system because it appeals to natural human cognition patterns. For some systems, an OO approach can speed development time since many objects are standard across systems and can be reused. Components that manage dates, shipping, shopping carts, etc. can be purchased and easily modified for a specific system. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What is the use of friend function? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Friend functions&lt;br /&gt;Sometimes a function is best shared among a number of different classes. Such functions can be declared either as member functions of one class or as global functions. In either case they can be set to be friends of other classes, by using a friend &lt;span class="SpellE"&gt;specifier&lt;/span&gt; in the class that is admitting them. Such functions can use all attributes of the class which names them as a friend, as if they were themselves members of that class.&lt;br /&gt;A friend declaration is essentially a prototype for a member function, but instead of requiring an implementation with the name of that class attached by the double colon syntax, a global function or member function of another class provides the match.&lt;br /&gt;class &lt;span class="SpellE"&gt;mylinkage&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;private:&lt;br /&gt;&lt;span class="SpellE"&gt;mylinkage&lt;/span&gt; * &lt;span class="SpellE"&gt;prev&lt;/span&gt;;&lt;br /&gt;&lt;span class="SpellE"&gt;mylinkage&lt;/span&gt; * next;&lt;br /&gt;&lt;br /&gt;protected:&lt;br /&gt;friend void &lt;span class="SpellE"&gt;set_prev&lt;/span&gt;(&lt;span class="SpellE"&gt;mylinkage&lt;/span&gt;* L, &lt;span class="SpellE"&gt;mylinkage&lt;/span&gt;* N);&lt;br /&gt;void &lt;span class="SpellE"&gt;set_next&lt;/span&gt;(&lt;span class="SpellE"&gt;mylinkage&lt;/span&gt;* L);&lt;br /&gt;&lt;br /&gt;public:&lt;br /&gt;&lt;span class="SpellE"&gt;mylinkage&lt;/span&gt; * &lt;span class="SpellE"&gt;succ&lt;/span&gt;();&lt;br /&gt;&lt;span class="SpellE"&gt;mylinkage&lt;/span&gt; * &lt;span class="SpellE"&gt;pred&lt;/span&gt;();&lt;br /&gt;&lt;span class="SpellE"&gt;mylinkage&lt;/span&gt;();&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void &lt;span class="SpellE"&gt;mylinkage::set_next&lt;/span&gt;(&lt;span class="SpellE"&gt;mylinkage&lt;/span&gt;* L) { next = L; }&lt;br /&gt;&lt;br /&gt;void &lt;span class="SpellE"&gt;set_prev&lt;/span&gt;(&lt;span class="SpellE"&gt;mylinkage&lt;/span&gt; * L, &lt;span class="SpellE"&gt;mylinkage&lt;/span&gt; * N ) { N-&gt;&lt;span class="SpellE"&gt;prev&lt;/span&gt; = L; }&lt;br /&gt;&lt;br /&gt;Friends in other classes&lt;br /&gt;It is possible to specify a member function of another class as a friend as follows:&lt;br /&gt;class C&lt;br /&gt;{&lt;br /&gt;friend &lt;span class="SpellE"&gt;int&lt;/span&gt; B::f1();&lt;br /&gt;};&lt;br /&gt;class B&lt;br /&gt;{&lt;br /&gt;&lt;span class="SpellE"&gt;int&lt;/span&gt; f1();&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;It is also possible to specify all the functions in another class as friends, by specifying the entire class as a friend.&lt;br /&gt;&lt;span class="GramE"&gt;class&lt;/span&gt; A&lt;br /&gt;{&lt;br /&gt;friend class B;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;Friend functions allow binary operators to be defined which combine private data in a pair of objects. This is particularly powerful when using the operator overloading features of C++. We will return to it when we look at overloading. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can we get second of the current time using date function? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;$second = &lt;span class="GramE"&gt;date(&lt;/span&gt;"s"); &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What is the maximum size of a file that can be uploaded using PHP and how can we change this? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;You can change maximum size of a file set &lt;span class="SpellE"&gt;upload_max_filesize&lt;/span&gt; variable in php.ini file &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can I make a script that can be bilingual (supports English, German)? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;You can change &lt;span class="SpellE"&gt;charset&lt;/span&gt; variable in above line in the script to support &lt;span class="SpellE"&gt;bilanguage&lt;/span&gt;. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;What are the difference between abstract class and interface? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;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.&lt;br /&gt;&lt;br /&gt;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 &lt;span class="GramE"&gt;define&lt;/span&gt; by its implemented class. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What are the advantages of stored procedures, triggers, indexes? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;A stored procedure is a set of SQL commands that can be compiled and stored in the server. Once this has been done, clients don't need to keep re-issuing the entire query but can refer to the stored procedure. This provides better overall performance because the query has to be parsed only once, and less information needs to be sent between the server and the client. You can also raise the conceptual level by having libraries of functions in the server. However, stored procedures of course do increase the load on the database server system, as more of the work is done on the server side and less on the client (application) side. Triggers will also be implemented. A trigger is effectively a type of stored procedure, one that is invoked when a particular event occurs. For example, you can install a stored procedure that is triggered each time a record is deleted from a transaction table and that stored procedure automatically deletes the corresponding customer from a customer table when all his transactions are deleted. Indexes are used to find rows with specific column values quickly. Without an index, MySQL must begin with the first row and then read through the entire table to find the relevant rows. &lt;span class="GramE"&gt;The larger the table, the more this costs.&lt;/span&gt; If the table has an index for the columns in question, MySQL can quickly determine the position to seek to in the middle of the data file without having to look at all the data. If a table has 1,000 rows, this is at least 100 times faster than reading sequentially. If you need to access most of the rows, it is faster to read sequentially, because this minimizes disk seeks. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-5817032257350185435?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/5817032257350185435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=5817032257350185435' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/5817032257350185435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/5817032257350185435'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/php-interview-questions-part13.html' title='Php interview Questions - part13'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-8685778516386094829</id><published>2008-04-14T23:42:00.002-07:00</published><updated>2008-04-14T23:43:28.901-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Php interview Questions'/><title type='text'>Php interview Questions - part12</title><content type='html'>&lt;p&gt;&lt;b&gt;HOW CAN WE TAKE A BACKUP OF A MYSQL TABLE AND HOW CAN WE RESTORE IT? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Answer 1:&lt;br /&gt;Create a full backup of your database: shell&gt; &lt;span class="SpellE"&gt;mysqldump&lt;/span&gt; tab=/path/to/some/dir opt &lt;span class="SpellE"&gt;db_name&lt;/span&gt;&lt;br /&gt;Or: shell&gt; &lt;span class="SpellE"&gt;mysqlhotcopy&lt;/span&gt; &lt;span class="SpellE"&gt;db_name&lt;/span&gt; /path/to/some/dir&lt;br /&gt;&lt;br /&gt;The full backup file is just a set of SQL statements, so restoring it is very easy:&lt;br /&gt;&lt;br /&gt;shell&gt; &lt;span class="SpellE"&gt;mysql&lt;/span&gt; "."Executed"&lt;span class="GramE"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Answer 2:&lt;br /&gt;To backup: BACKUP TABLE &lt;span class="SpellE"&gt;tbl_name&lt;/span&gt; TO /path/to/backup/directory&lt;br /&gt;’ To restore: RESTORE TABLE &lt;span class="SpellE"&gt;tbl_name&lt;/span&gt; FROM /path/to/backup/directory&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="SpellE"&gt;mysqldump&lt;/span&gt;: Dumping Table Structure and Data&lt;br /&gt;&lt;br /&gt;Utility to dump a database or a collection of database for backup or for transferring the data to another SQL server (not necessarily a MySQL server). The dump will contain SQL statements to create the table and/or populate the table.&lt;br /&gt;-t, no-create-info&lt;br /&gt;&lt;span class="GramE"&gt;Don't&lt;/span&gt; write table creation information (the CREATE TABLE statement).&lt;br /&gt;-&lt;span class="GramE"&gt;d&lt;/span&gt;, no-data&lt;br /&gt;Don't write any row information for the table. This is very useful if you just want to get a dump of the structure for a table! &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How to set cookies? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;setcookie&lt;/span&gt;('&lt;span class="SpellE"&gt;variable','value','time&lt;/span&gt;')&lt;br /&gt;;&lt;br /&gt;variable - name of the cookie variable&lt;br /&gt;value - value of the cookie variable&lt;br /&gt;time - expiry time&lt;br /&gt;Example: &lt;span class="SpellE"&gt;setcookie&lt;/span&gt;('&lt;span class="SpellE"&gt;Test',$i,time&lt;/span&gt;()+3600);&lt;br /&gt;&lt;br /&gt;Test - cookie variable name&lt;br /&gt;$&lt;span class="SpellE"&gt;i&lt;/span&gt; - value of the variable 'Test'&lt;br /&gt;time()+3600 - denotes that the cookie will expire after an one hour &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How to reset/destroy a cookie &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Reset a cookie by specifying expire time in the past&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;Example: &lt;span class="SpellE"&gt;setcookie&lt;/span&gt;('&lt;span class="SpellE"&gt;Test',$i,time&lt;/span&gt;()-3600); // already expired time&lt;br /&gt;&lt;br /&gt;Reset a cookie by specifying its name only&lt;br /&gt;Example: &lt;span class="SpellE"&gt;setcookie&lt;/span&gt;('Test'); &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;WHAT TYPES OF IMAGES THAT PHP SUPPORTS? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Using &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;imagetypes&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) function to find out what types of images are supported in your PHP engine.&lt;br /&gt;&lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;imagetypes&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) - Returns the image types supported.&lt;br /&gt;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. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;CHECK IF A VARIABLE IS AN INTEGER IN JAVASCRIPT &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;var&lt;/span&gt;&lt;/span&gt; &lt;span class="SpellE"&gt;myValue&lt;/span&gt; =9.8;&lt;br /&gt;if(&lt;span class="SpellE"&gt;parseInt&lt;/span&gt;(&lt;span class="SpellE"&gt;myValue&lt;/span&gt;)== &lt;span class="SpellE"&gt;myValue&lt;/span&gt;)&lt;br /&gt;alert('Integer');&lt;br /&gt;else&lt;br /&gt;alert('Not an integer');&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Tools used for drawing ER diagrams. &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Case Studio&lt;br /&gt;Smart Draw &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can I know that a variable is a number or not using a JavaScript? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Answer 1&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span class="SpellE"&gt;bool&lt;/span&gt; &lt;span class="SpellE"&gt;is_numeric&lt;/span&gt;( mixed &lt;span class="SpellE"&gt;var&lt;/span&gt;)&lt;br /&gt;Returns TRUE if &lt;span class="SpellE"&gt;var&lt;/span&gt; is a number or a numeric string, FALSE otherwise.&lt;br /&gt;&lt;br /&gt;Answer 2&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;Definition and Usage&lt;br /&gt;The &lt;span class="SpellE"&gt;isNaN&lt;/span&gt;() function is used to check if a value is not a number.&lt;br /&gt;&lt;br /&gt;Syntax&lt;br /&gt;&lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;isNaN&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;number)&lt;br /&gt;&lt;br /&gt;Parameter Description&lt;br /&gt;number Required. The value to be tested&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can we submit from without a submit button? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Trigger the JavaScript code on any event &lt;span class="GramE"&gt;( like&lt;/span&gt; &lt;span class="SpellE"&gt;onSelect&lt;/span&gt; of drop down list box, &lt;span class="SpellE"&gt;onfocus&lt;/span&gt;, etc ) &lt;span class="SpellE"&gt;document.myform.submit&lt;/span&gt;(); This will submit the form. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How many ways can we get the value of current session id? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;session_&lt;span class="GramE"&gt;id&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) returns the session id for the current session. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can we destroy the cookie? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Set the cookie with a past expiration time. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What are the current versions of Apache, PHP, and MySQL? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;PHP: PHP 5.1.2&lt;br /&gt;MySQL: MySQL 5.1&lt;br /&gt;Apache: Apache 2.1&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What are the reasons for selecting LAMP (Linux, Apache, MySQL, &lt;span class="SpellE"&gt;Php&lt;/span&gt;) instead of combination of other software programs, servers and operating systems? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;All of those are open source resource. Security of &lt;span class="SpellE"&gt;linux&lt;/span&gt; is very &lt;span class="SpellE"&gt;very&lt;/span&gt; more than windows. Apache is a better server that IIS both in functionality and security. Mysql is world most popular open source database. &lt;span class="SpellE"&gt;Php&lt;/span&gt; is &lt;span class="GramE"&gt;more faster&lt;/span&gt; that asp or any other scripting language. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-8685778516386094829?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/8685778516386094829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=8685778516386094829' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/8685778516386094829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/8685778516386094829'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/php-interview-questions-part12.html' title='Php interview Questions - part12'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-8777374257652440744</id><published>2008-04-14T23:42:00.001-07:00</published><updated>2008-04-14T23:42:34.487-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Php interview Questions'/><title type='text'>Php interview Questions - part11</title><content type='html'>&lt;p&gt;&lt;b&gt;What are the differences between &lt;span class="SpellE"&gt;mysql_fetch_&lt;span class="GramE"&gt;array&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;), &lt;span class="SpellE"&gt;mysql_fetch_object&lt;/span&gt;(), &lt;span class="SpellE"&gt;mysql_fetch_row&lt;/span&gt;()? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;mysql_fetch_array&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt; - Fetch a result row as an associative array and a numeric array.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="SpellE"&gt;mysql_fetch_object&lt;/span&gt; - Returns an object with properties that correspond to the fetched row and moves the internal data pointer ahead. Returns an object with properties that correspond to the fetched row, or FALSE if there are no more rows&lt;br /&gt;&lt;br /&gt;&lt;span class="SpellE"&gt;mysql_fetch_&lt;span class="GramE"&gt;row&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) - Fetches one row of data from the result associated with the specified result identifier. The row is returned as an array. Each result column is stored in an array offset, starting at offset 0. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What is meant by &lt;span class="GramE"&gt;nl2br(&lt;/span&gt;)? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Anwser1:&lt;br /&gt;&lt;span class="GramE"&gt;nl2br(&lt;/span&gt;) inserts a HTML tag &lt;&lt;span class="SpellE"&gt;br&lt;/span&gt;&gt; before all new line characters \n in a string.&lt;br /&gt;&lt;br /&gt;&lt;span class="GramE"&gt;echo&lt;/span&gt; nl2br("god bless \n you");&lt;br /&gt;&lt;br /&gt;output:&lt;br /&gt;god bless&lt;&lt;span class="SpellE"&gt;br&lt;/span&gt;&gt;&lt;br /&gt;you&lt;/p&gt;  &lt;p&gt;&lt;b&gt;How can we encrypt and decrypt a data presented in a table using MySQL? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;You can use functions: AES_&lt;span class="GramE"&gt;ENCRYPT(&lt;/span&gt;) and AES_DECRYPT() like:&lt;br /&gt;&lt;br /&gt;AES_ENCRYPT(&lt;span class="SpellE"&gt;str&lt;/span&gt;, &lt;span class="SpellE"&gt;key_str&lt;/span&gt;)&lt;br /&gt;AES_DECRYPT(&lt;span class="SpellE"&gt;crypt_str&lt;/span&gt;, &lt;span class="SpellE"&gt;key_str&lt;/span&gt;) &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can I retrieve values from one database server and store them in other database server using PHP? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;For this purpose, you can first read the data from one server into session variables. Then connect to other server and simply insert the data into the database. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;WHO IS THE FATHER OF PHP AND WHAT IS THE CURRENT VERSION OF PHP AND MYSQL? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;Rasmus&lt;/span&gt; &lt;span class="SpellE"&gt;Lerdorf&lt;/span&gt;.&lt;br /&gt;&lt;span class="GramE"&gt;PHP 5.1.&lt;/span&gt; Beta&lt;br /&gt;MySQL 5.0 &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;IN HOW MANY WAYS WE CAN RETRIEVE DATA IN THE RESULT SET OF MYSQL USING PHP? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;mysql_fetch_array&lt;/span&gt; - Fetch a result row as an associative array, a numeric array, or both&lt;br /&gt;&lt;span class="SpellE"&gt;mysql_fetch_assoc&lt;/span&gt; - Fetch a result row as an associative array&lt;br /&gt;&lt;span class="SpellE"&gt;mysql_fetch_object&lt;/span&gt; - Fetch a result row as an object&lt;br /&gt;&lt;span class="SpellE"&gt;mysql_fetch_row&lt;/span&gt; —- Get a result row as an enumerated array &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What are the functions for IMAP? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;imap_body&lt;/span&gt; - Read the message body&lt;br /&gt;&lt;span class="SpellE"&gt;imap_check&lt;/span&gt; - Check current mailbox&lt;br /&gt;&lt;span class="SpellE"&gt;imap_delete&lt;/span&gt; - Mark a message for deletion from current mailbox&lt;br /&gt;&lt;span class="SpellE"&gt;imap_mail&lt;/span&gt; - Send an email message &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What are encryption functions in PHP? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="GramE"&gt;CRYPT(&lt;/span&gt;)&lt;br /&gt;MD5() &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What is the difference between &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;htmlentities&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) and &lt;span class="SpellE"&gt;htmlspecialchars&lt;/span&gt;()? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;htmlspecialchars&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) - Convert some special characters to HTML entities (Only the most widely used)&lt;br /&gt;&lt;span class="SpellE"&gt;htmlentities&lt;/span&gt;() - Convert ALL special characters to HTML entities &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What is the functionality of the function &lt;span class="SpellE"&gt;htmlentities&lt;/span&gt;? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;htmlentities&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) - Convert all applicable characters to HTML entities&lt;br /&gt;This function is identical to &lt;span class="SpellE"&gt;htmlspecialchars&lt;/span&gt;() in all ways, except with &lt;span class="SpellE"&gt;htmlentities&lt;/span&gt;(), all characters which have HTML character entity equivalents are translated into these entities. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;How can we get the properties (size, type, width, height) of an image using &lt;span class="SpellE"&gt;php&lt;/span&gt; image functions? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;To know the image size use &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;getimagesize&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) function&lt;br /&gt;To know the image width use &lt;span class="SpellE"&gt;imagesx&lt;/span&gt;() function&lt;br /&gt;To know the image height use &lt;span class="SpellE"&gt;imagesy&lt;/span&gt;() function&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can we increase the execution time of a &lt;span class="SpellE"&gt;php&lt;/span&gt; script? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;By the use of void &lt;span class="SpellE"&gt;set_time_&lt;span class="GramE"&gt;limit&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;&lt;span class="SpellE"&gt;int&lt;/span&gt; seconds)&lt;br /&gt;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 &lt;span class="SpellE"&gt;max_execution_time&lt;/span&gt; value defined in the php.ini. If seconds is set to zero, no time limit is imposed.&lt;br /&gt;&lt;br /&gt;When called, &lt;span class="SpellE"&gt;set_time_&lt;span class="GramE"&gt;limit&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) 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 &lt;span class="SpellE"&gt;set_time_&lt;span class="GramE"&gt;limit&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;20) is made, the script will run for a total of 45 seconds before timing out. &lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-8777374257652440744?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/8777374257652440744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=8777374257652440744' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/8777374257652440744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/8777374257652440744'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/php-interview-questions-part11.html' title='Php interview Questions - part11'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-2023706990683517595</id><published>2008-04-14T23:41:00.001-07:00</published><updated>2008-04-14T23:41:57.263-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Php interview Questions'/><title type='text'>Php interview Questions - part10</title><content type='html'>&lt;p&gt;&lt;b&gt;How can we change the name of a column of a table? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;This will change the name of column&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;ALTER TABLE &lt;span class="SpellE"&gt;table_name&lt;/span&gt; CHANGE &lt;span class="SpellE"&gt;old_colm_name&lt;/span&gt; &lt;span class="SpellE"&gt;new_colm_name&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;How can we change the data type of a column of a table? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;This will change the data type of a column&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;ALTER TABLE &lt;span class="SpellE"&gt;table_name&lt;/span&gt; CHANGE &lt;span class="SpellE"&gt;colm_name&lt;/span&gt; &lt;span class="SpellE"&gt;same_colm_name&lt;/span&gt; [new data type]&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What is the difference between GROUP BY and ORDER BY in SQL? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;To sort a result, use an ORDER BY clause.&lt;br /&gt;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).&lt;br /&gt;ORDER BY [col1]&lt;span class="GramE"&gt;,[&lt;/span&gt;col2],...[&lt;span class="SpellE"&gt;coln&lt;/span&gt;]; Tells DBMS according to what columns it should sort the result. If two rows will &lt;span class="SpellE"&gt;hawe&lt;/span&gt; the same value in col1 it will try to sort them according to col2 and so on.&lt;br /&gt;GROUP BY [col1]&lt;span class="GramE"&gt;,[&lt;/span&gt;col2],...[&lt;span class="SpellE"&gt;coln&lt;/span&gt;]; Tells DBMS to group (aggregate) results with same value of column col1. You can use &lt;span class="GramE"&gt;COUNT(&lt;/span&gt;col1), SUM(col1), AVG(col1) with it, if you want to count all items in group, sum all values or view average. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What is meant by MIME? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Answer 1&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;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&lt;span class="GramE"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Some examples of MIME types:&lt;br /&gt;audio/x-ms-&lt;span class="SpellE"&gt;wmp&lt;/span&gt;&lt;br /&gt;image/&lt;span class="SpellE"&gt;png&lt;/span&gt;&lt;br /&gt;&lt;span class="SpellE"&gt;aplication&lt;/span&gt;/x-shockwave-flash&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Answer 2:&lt;br /&gt;Multipurpose Internet Mail Extensions.&lt;br /&gt;&lt;span class="SpellE"&gt;WWW's&lt;/span&gt; ability to recognize and handle files of different types is largely dependent on the use of the MIME (Multipurpose Internet Mail Extensions) standard. The standard provides for a system of registration of file types with information about the applications needed to process them. This information is incorporated into Web server and browser software, and enables the automatic recognition and display of registered file types. … &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can we know that a session is started or not? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;A session starts by &lt;span class="SpellE"&gt;session_&lt;span class="GramE"&gt;start&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) function.&lt;br /&gt;This &lt;span class="SpellE"&gt;session_&lt;span class="GramE"&gt;start&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) is always declared in header portion. &lt;span class="GramE"&gt;it&lt;/span&gt; always declares first. &lt;span class="GramE"&gt;then&lt;/span&gt; we write &lt;span class="SpellE"&gt;session_register&lt;/span&gt;(). &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What are the differences between &lt;span class="SpellE"&gt;mysql_fetch_&lt;span class="GramE"&gt;array&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;), &lt;span class="SpellE"&gt;mysql_fetch_object&lt;/span&gt;(), &lt;span class="SpellE"&gt;mysql_fetch_row&lt;/span&gt;()? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Answer 1:&lt;br /&gt;&lt;span class="SpellE"&gt;mysql_fetch_&lt;span class="GramE"&gt;array&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) -&gt; Fetch a result row as a combination of associative array and regular array.&lt;br /&gt;&lt;span class="SpellE"&gt;mysql_fetch_&lt;span class="GramE"&gt;object&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) -&gt; Fetch a result row as an object.&lt;br /&gt;&lt;span class="SpellE"&gt;mysql_fetch_&lt;span class="GramE"&gt;row&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) -&gt; Fetch a result set as a regular array().&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Answer 2&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;The difference between &lt;span class="SpellE"&gt;mysql_fetch_row&lt;/span&gt;() and &lt;span class="SpellE"&gt;mysql_fetch_array&lt;/span&gt;() is that the first returns the results in a numeric array ($row[0], $row[1], etc.), while the latter returns a the results an array containing both numeric and associative keys ($row['name'], $row['email'], etc.). &lt;span class="SpellE"&gt;mysql_fetch_&lt;span class="GramE"&gt;object&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) returns an object ($row-&gt;name, $row-&gt;email, etc.). &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;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? &lt;span class="GramE"&gt;And if yes then why?&lt;/span&gt; &lt;span class="GramE"&gt;If no then why?&lt;/span&gt; &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Session depends on browser. If browser is closed then session is lost. The session data will be deleted after session time out. If connection is lost and you recreate connection, then session will continue in the browser. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;What are the MySQL database files stored in &lt;span class="GramE"&gt;system ?&lt;/span&gt; &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Data is stored in &lt;span class="SpellE"&gt;name.myd&lt;/span&gt;&lt;br /&gt;Table structure is stored in &lt;span class="SpellE"&gt;name.frm&lt;/span&gt;&lt;br /&gt;Index is stored in &lt;span class="SpellE"&gt;name.myi&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What is the difference between PHP4 and PHP5? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;PHP4 cannot support oops concepts and &lt;span class="SpellE"&gt;Zend&lt;/span&gt; engine 1 is used.&lt;br /&gt;&lt;br /&gt;PHP5 supports oops concepts and &lt;span class="SpellE"&gt;Zend&lt;/span&gt; engine 2 is used.&lt;br /&gt;Error supporting is increased in PHP5.&lt;br /&gt;XML and &lt;span class="SpellE"&gt;SQLLite&lt;/span&gt; will is increased in PHP5.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;Can we use &lt;span class="GramE"&gt;include(&lt;/span&gt;&lt;span class="SpellE"&gt;abc.PHP&lt;/span&gt;) two times in a PHP page &lt;span class="SpellE"&gt;makeit.PHP&lt;/span&gt;”? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Yes we can include that many times we want, but here are some things to make sure of:&lt;br /&gt;(including &lt;span class="SpellE"&gt;abc.PHP&lt;/span&gt;, the file names are case-sensitive)&lt;br /&gt;there shouldn't be any duplicate function names, means there should not be functions or classes or variables with the same name in &lt;span class="SpellE"&gt;abc.PHP&lt;/span&gt; and &lt;span class="SpellE"&gt;makeit.php&lt;/span&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-2023706990683517595?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/2023706990683517595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=2023706990683517595' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/2023706990683517595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/2023706990683517595'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/php-interview-questions-part10.html' title='Php interview Questions - part10'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-4360065743556898286</id><published>2008-04-14T23:40:00.000-07:00</published><updated>2008-04-14T23:41:05.391-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Php interview Questions'/><title type='text'>Php interview Questions - part9</title><content type='html'>&lt;p&gt;&lt;b&gt;How can we find the number of rows in a result set using PHP? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Here is how can you find the number of rows in a result set in PHP&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;$result = mysql_query($&lt;span class="SpellE"&gt;any_valid_sql&lt;/span&gt;, $&lt;span class="SpellE"&gt;database_link&lt;/span&gt;);&lt;br /&gt;$&lt;span class="SpellE"&gt;num_rows&lt;/span&gt; = &lt;span class="SpellE"&gt;mysql_num_rows&lt;/span&gt;($result);&lt;br /&gt;echo "$&lt;span class="SpellE"&gt;num_rows&lt;/span&gt; rows found";&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How many ways we can we find the current date using MySQL? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;SELECT &lt;span class="GramE"&gt;CURDATE(&lt;/span&gt;);&lt;br /&gt;SELECT CURRENT_DATE();&lt;br /&gt;SELECT CURTIME();&lt;br /&gt;SELECT CURRENT_TIME();&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;Give the syntax of GRANT commands? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The generic syntax for GRANT is as following&lt;br /&gt;&lt;br /&gt;GRANT [rights] on [database] TO [&lt;span class="SpellE"&gt;username@hostname&lt;/span&gt;] IDENTIFIED BY [password]&lt;br /&gt;&lt;br /&gt;Now rights can be:&lt;br /&gt;a) ALL &lt;span class="SpellE"&gt;privilages&lt;/span&gt;&lt;br /&gt;b) Combination of CREATE, DROP, SELECT, INSERT, UPDATE and DELETE etc.&lt;br /&gt;&lt;br /&gt;We can grant rights on all &lt;span class="SpellE"&gt;databse&lt;/span&gt; by &lt;span class="SpellE"&gt;usingh&lt;/span&gt; *.* or some specific database by database.* or a specific table by &lt;span class="SpellE"&gt;database.table_name&lt;/span&gt;. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Give the syntax of REVOKE commands? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The generic syntax for revoke is as following&lt;br /&gt;&lt;br /&gt;REVOKE [rights] on [database] FROM [&lt;span class="SpellE"&gt;username@hostname&lt;/span&gt;]&lt;br /&gt;&lt;br /&gt;Now rights can be:&lt;br /&gt;a) ALL &lt;span class="SpellE"&gt;privilages&lt;/span&gt;&lt;br /&gt;b) Combination of CREATE, DROP, SELECT, INSERT, UPDATE and DELETE etc.&lt;br /&gt;&lt;br /&gt;We can grant rights on all &lt;span class="SpellE"&gt;databse&lt;/span&gt; by &lt;span class="SpellE"&gt;usingh&lt;/span&gt; *.* or some specific database by database.* or a specific table by &lt;span class="SpellE"&gt;database.table_name&lt;/span&gt;.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;What is the difference between CHAR and VARCHAR data types? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;CHAR is a fixed length data type. &lt;span class="GramE"&gt;CHAR(&lt;/span&gt;n) will take n characters of storage even if you enter less than n characters to that column. For example, "Hello!" will be stored as "Hello&lt;span class="GramE"&gt;! "&lt;/span&gt; in CHAR(10) column. &lt;/p&gt;  &lt;p&gt;VARCHAR is a variable length data type. &lt;span class="GramE"&gt;VARCHAR(&lt;/span&gt;n) will take only the required storage for the actual number of characters entered to that column. For example, "Hello!" will be stored as "Hello!" in &lt;span class="GramE"&gt;VARCHAR(&lt;/span&gt;10) column. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;How can we encrypt and decrypt a data present in a &lt;span class="SpellE"&gt;mysql&lt;/span&gt; table using &lt;span class="SpellE"&gt;mysql&lt;/span&gt;? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;AES_&lt;span class="GramE"&gt;ENCRYPT(&lt;/span&gt;) and AES_DECRYPT() &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;Will comparison of string "10" and integer 11 &lt;span class="GramE"&gt;work&lt;/span&gt; in PHP? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Yes, internally PHP will cast everything to the integer type, so numbers 10 and 11 will be compared. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What is the functionality of MD5 function in PHP? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="GramE"&gt;string&lt;/span&gt; md5(string)&lt;br /&gt;&lt;br /&gt;It calculates the MD5 hash of a string. The hash is a 32-character hexadecimal number. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can I load data from a text file into a table? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The MySQL provides a LOAD DATA INFILE command. You can load data from a file. Great tool but you need to make sure that&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;a) Data must be delimited&lt;br /&gt;b) Data fields must match table columns correctly&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can we know the number of days between two given dates using MySQL? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Use &lt;span class="GramE"&gt;DATEDIFF(&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;SELECT DATEDIFF(NOW(),'2006-07-01');&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-4360065743556898286?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/4360065743556898286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=4360065743556898286' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/4360065743556898286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/4360065743556898286'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/php-interview-questions-part9.html' title='Php interview Questions - part9'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-8261180945467360057</id><published>2008-04-14T23:39:00.001-07:00</published><updated>2008-04-14T23:39:57.310-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Php interview Questions'/><title type='text'>Php interview Questions - part8</title><content type='html'>&lt;p&gt;&lt;b&gt;What’s the difference between &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;htmlentities&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) and &lt;span class="SpellE"&gt;htmlspecialchars&lt;/span&gt;()? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;htmlspecialchars&lt;/span&gt;&lt;/span&gt; only takes care of &lt;, &gt;, single quote ‘, double quote " and ampersand. &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;htmlentities&lt;/span&gt;&lt;/span&gt; translates all occurrences of character sequences that have different meaning in HTML. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can we extract string "abc.com" from a string "mailto:info@abc.com?subject=Feedback" using regular expression of PHP? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;$text = "mailto:info@abc.com?subject=Feedback";&lt;br /&gt;preg_match('|.*@([^?]*)|', $text, $output)&lt;span class="GramE"&gt;;&lt;/span&gt;&lt;br /&gt;echo $output[1];&lt;br /&gt;&lt;br /&gt;Note that the second index of $output, $output[1], gives the match, not the first one, $output[0]. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;So if &lt;span class="GramE"&gt;md5(&lt;/span&gt;) generates the most secure hash, why would you ever use the less secure crc32() and sha1()? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Crypto usage in PHP is simple, but that doesn’t mean it’s free. First off, depending on the data that you’re encrypting, you might have reasons to store a 32-bit value in the database instead of the 160-bit value to save on space. Second, the more secure the crypto is, the longer is the computation time to deliver the hash value. A high volume site might be significantly slowed down, if frequent &lt;span class="GramE"&gt;md5(&lt;/span&gt;) generation is required. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can we destroy the session, how can we unset the variable of a session? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;session_&lt;span class="GramE"&gt;unregister&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) - &lt;span class="SpellE"&gt;Unregister&lt;/span&gt; a global variable from the current session&lt;br /&gt;&lt;span class="SpellE"&gt;session_unset&lt;/span&gt;() - Free all session variables &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What are the different functions in sorting an array? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Sorting functions in PHP:&lt;br /&gt;&lt;span class="SpellE"&gt;asort&lt;/span&gt;()&lt;br /&gt;&lt;span class="SpellE"&gt;arsort&lt;/span&gt;()&lt;br /&gt;&lt;span class="SpellE"&gt;ksort&lt;/span&gt;()&lt;br /&gt;&lt;span class="SpellE"&gt;krsort&lt;/span&gt;()&lt;br /&gt;&lt;span class="SpellE"&gt;uksort&lt;/span&gt;()&lt;br /&gt;sort()&lt;br /&gt;&lt;span class="SpellE"&gt;natsort&lt;/span&gt;()&lt;br /&gt;&lt;span class="SpellE"&gt;rsort&lt;/span&gt;() &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can we know the count/number of elements of an array? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;2 ways&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;a) &lt;span class="SpellE"&gt;sizeof&lt;/span&gt;($array) - This function is an alias of count()&lt;br /&gt;b) count($&lt;span class="SpellE"&gt;urarray&lt;/span&gt;) - This function returns the number of elements in an array.&lt;br /&gt;Interestingly if you just pass a simple &lt;span class="SpellE"&gt;var&lt;/span&gt; instead of an array, &lt;span class="GramE"&gt;count(&lt;/span&gt;) will return 1. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How many ways we can pass the variable through the navigation between the pages? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;At least 3 ways:&lt;br /&gt;&lt;br /&gt;1. Put the variable into session in the first page, and get it back from session in the next page.&lt;br /&gt;2. Put the variable into cookie in the first page, and get it back from the cookie in the next page.&lt;br /&gt;3. Put the variable into a hidden form field, and get it back from the form in the next page. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;What is the maximum length of a table name, a database name, or a field name in MySQL? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Database name: 64 characters&lt;br /&gt;Table name: 64 characters&lt;br /&gt;Column name: 64 characters&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How many values can the SET function of MySQL take? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;MySQL SET function can take zero or more values, but at the maximum it can take 64 values. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What are the other commands to know the structure of a table using MySQL commands except EXPLAIN command? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;DESCRIBE &lt;span class="SpellE"&gt;table_name&lt;/span&gt;; &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can we find the number of rows in a table using MySQL?&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Use this for MySQL&lt;br /&gt;&lt;br /&gt;SELECT &lt;span class="GramE"&gt;COUNT(&lt;/span&gt;*) FROM &lt;span class="SpellE"&gt;table_name&lt;/span&gt;;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What’s the difference between &lt;span class="GramE"&gt;md5(&lt;/span&gt;), crc32() and sha1() crypto on PHP? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The major difference is the length of the hash generated. CRC32 is, evidently, 32 bits, while &lt;span class="GramE"&gt;sha1(&lt;/span&gt;) returns a 128 bit value, and md5() returns a 160 bit value. This is important when avoiding collisions. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-8261180945467360057?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/8261180945467360057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=8261180945467360057' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/8261180945467360057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/8261180945467360057'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/php-interview-questions-part8.html' title='Php interview Questions - part8'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-2708096321418953695</id><published>2008-04-14T23:38:00.000-07:00</published><updated>2008-04-14T23:39:14.896-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Php interview Questions'/><title type='text'>Php interview Questions - part7</title><content type='html'>&lt;p&gt;&lt;b&gt;How come the code works, but doesn’t for two-dimensional array of mine? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Any time you have an array with more than one dimension, complex parsing syntax is required. &lt;span class="GramE"&gt;print&lt;/span&gt; "Contents: {$&lt;span class="SpellE"&gt;arr&lt;/span&gt;[1][2]}" would’ve worked. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can we register the variables into a session? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;session_&lt;span class="GramE"&gt;register&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;$&lt;span class="SpellE"&gt;session_var&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;$_SESSION['&lt;span class="SpellE"&gt;var&lt;/span&gt;'] = 'value';&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What is the difference between characters \023 and \x23? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The first one is octal 23, the second is hex 23. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;With &lt;span class="GramE"&gt;a &lt;span class="SpellE"&gt;heredoc&lt;/span&gt;&lt;/span&gt; syntax, do I get variable substitution inside the &lt;span class="SpellE"&gt;heredoc&lt;/span&gt; contents? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Yes. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can we submit form without a submit button? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;We can use a simple JavaScript code linked to an event trigger of any form field. In the JavaScript code, we can call the &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;document.form.submit&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) function to submit the form. For example: &lt;input type="button" value="Save" class="SpellE"&gt;onClick&lt;/span&gt;="&lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;document.form.submit&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;)"&gt; &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can we create a database using PHP and &lt;span class="SpellE"&gt;mysql&lt;/span&gt;? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;We can create MySQL database with the use of &lt;span class="SpellE"&gt;mysql_create_&lt;span class="GramE"&gt;db&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;$&lt;span class="SpellE"&gt;databaseName&lt;/span&gt;) to create a database.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How many ways we can retrieve the date in result set of &lt;span class="SpellE"&gt;mysql&lt;/span&gt; using &lt;span class="SpellE"&gt;php&lt;/span&gt;? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;As individual objects so single record or as a set or arrays. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;Can we use include ("&lt;span class="SpellE"&gt;abc.php&lt;/span&gt;") two times in a &lt;span class="SpellE"&gt;php&lt;/span&gt; page "&lt;span class="SpellE"&gt;makeit.php&lt;/span&gt;"? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Yes. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;For printing out strings, there are echo, print and &lt;span class="SpellE"&gt;printf&lt;/span&gt;. Explain the differences. &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="GramE"&gt;echo&lt;/span&gt; is the most primitive of them, and just outputs the contents following the construct to the screen. &lt;span class="GramE"&gt;print&lt;/span&gt; is also a construct (so parentheses are optional when calling it), but it returns TRUE on successful output and FALSE if it was unable to print out the string. However, you can pass multiple parameters to echo, like:&lt;br /&gt;&lt;br /&gt;&lt;&lt;span class="GramE"&gt;?&lt;span class="SpellE"&gt;php&lt;/span&gt;&lt;/span&gt; echo 'Welcome ', 'to', ' &lt;span class="SpellE"&gt;'&lt;/span&gt;, '&lt;span class="SpellE"&gt;fyicenter&lt;/span&gt;!'; ?&gt;&lt;br /&gt;&lt;br /&gt;and it will output the string "Welcome to &lt;span class="SpellE"&gt;fyicenter&lt;/span&gt;!" print does not take multiple parameters. It is also generally argued that echo is faster, but usually the speed advantage is negligible, and might not be there for future versions of PHP. &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;printf&lt;/span&gt;&lt;/span&gt; is a function, not a construct, and allows such advantages as formatted output, but it’s the slowest way to print out data out of echo, print and &lt;span class="SpellE"&gt;printf&lt;/span&gt;. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;I am writing an application in PHP that outputs a printable version of driving directions. It contains some long sentences, and I am a neat freak, and would like to make sure that no line exceeds 50 characters. How do I accomplish that with PHP? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;On large strings that need to be formatted according to some length specifications, use &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;wordwrap&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) or &lt;span class="SpellE"&gt;chunk_split&lt;/span&gt;(). &lt;/p&gt;  &lt;p&gt;&lt;b&gt;What’s the output of the &lt;span class="SpellE"&gt;ucwords&lt;/span&gt; function in this example? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;$formatted = &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;ucwords&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;"FYICENTER IS COLLECTION OF INTERVIEW QUESTIONS");&lt;br /&gt;print $formatted;&lt;br /&gt;What will be printed is FYICENTER IS COLLECTION OF INTERVIEW QUESTIONS.&lt;br /&gt;&lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;ucwords&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) makes every first letter of every word capital, but it does not lower-case anything else. To avoid this, and get a properly formatted string, it’s worth using &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;strtolower&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) first. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-2708096321418953695?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/2708096321418953695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=2708096321418953695' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/2708096321418953695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/2708096321418953695'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/php-interview-questions-part7.html' title='Php interview Questions - part7'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-1070107343428351796</id><published>2008-04-14T23:36:00.000-07:00</published><updated>2008-04-14T23:37:06.418-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Php interview Questions'/><title type='text'>Php interview Questions - part6</title><content type='html'>&lt;p&gt;&lt;b&gt;How do you call a constructor for a parent class? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;parent::&lt;span class="GramE"&gt;constructor&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;$value) &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;WHAT ARE THE DIFFERENT TYPES OF ERRORS IN PHP? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Here are three basic types of runtime errors in PHP&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. Notices: These are trivial, non-critical errors that PHP encounters while executing a script - for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all - although you can change this default behavior.&lt;br /&gt;&lt;br /&gt;2. Warnings: These are more serious errors - for example, attempting to &lt;span class="GramE"&gt;include(&lt;/span&gt;) a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.&lt;br /&gt;&lt;br /&gt;3. Fatal errors: These are critical errors - for example, instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and &lt;span class="SpellE"&gt;PHP's&lt;/span&gt; default behavior is to display them to the user when they take place.&lt;br /&gt;&lt;br /&gt;Internally, these variations are represented by twelve different error types &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What’s the special meaning of __sleep and __wakeup? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;__sleep returns the array of all the variables than need to be saved, while __wakeup retrieves them. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can we submit a form without a submit button? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;If you don't want to use the Submit button to submit a form, you can use normal hyper links to submit a form. But you need to use some JavaScript code in the URL of the link. For example:&lt;br /&gt;&lt;br /&gt;&lt;a class="SpellE"&gt;href&lt;/span&gt;="&lt;span class="SpellE"&gt;javascript&lt;/span&gt;: &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;document.myform.submit&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;);"&gt;Submit Me&lt;/a&gt; &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;Why doesn’t the following code print the &lt;span class="SpellE"&gt;newline&lt;/span&gt; properly? &lt;span class="GramE"&gt;&lt;?&lt;span class="SpellE"&gt;php&lt;/span&gt;&lt;/span&gt; $&lt;span class="SpellE"&gt;str&lt;/span&gt; = ‘Hello, there.\&lt;span class="SpellE"&gt;nHow&lt;/span&gt; are you?\&lt;span class="SpellE"&gt;nThanks&lt;/span&gt; for visiting &lt;span class="SpellE"&gt;fyicenter&lt;/span&gt;’; print $&lt;span class="SpellE"&gt;str&lt;/span&gt;; ?&gt; &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Because inside the single quotes the \n character is not interpreted as &lt;span class="SpellE"&gt;newline&lt;/span&gt;, just as a sequence of two characters - \ and n. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;Would you initialize your strings with single quotes or double quotes? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Since the data inside the single-quoted string is not parsed for variable substitution, it’s always a better idea speed-wise to initialize a string with single quotes, unless you specifically need variable substitution. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can we extract string 'abc.com ' from a string http://info@abc.com using regular expression of &lt;span class="SpellE"&gt;php&lt;/span&gt;? &lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;We can use the &lt;span class="SpellE"&gt;preg_&lt;span class="GramE"&gt;match&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) function with "/.*@(.*)$/" as &lt;/pre&gt;&lt;pre&gt;&lt;span class="GramE"&gt;the&lt;/span&gt; regular expression pattern. For example: &lt;/pre&gt;&lt;pre&gt;&lt;span class="SpellE"&gt;preg_&lt;span class="GramE"&gt;match&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;"/.*@(.*)$/","http://info@abc.com",$data);&lt;/pre&gt;&lt;pre&gt;&lt;span class="GramE"&gt;echo&lt;/span&gt; $data[1];&lt;/pre&gt;  &lt;p&gt;&lt;b&gt;What is the difference between the functions unlink and unset? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="GramE"&gt;unlink(&lt;/span&gt;) is a function for file system handling. It will simply delete the file in context.&lt;br /&gt;&lt;br /&gt;&lt;span class="GramE"&gt;unset(&lt;/span&gt;) is a function for variable management. It will make a variable undefined. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-1070107343428351796?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/1070107343428351796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=1070107343428351796' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/1070107343428351796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/1070107343428351796'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/php-interview-questions-part6.html' title='Php interview Questions - part6'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-9043471741364779682</id><published>2008-04-14T23:35:00.000-07:00</published><updated>2008-04-14T23:36:38.261-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Php interview Questions'/><title type='text'>Php interview Questions - part5</title><content type='html'>&lt;p&gt;&lt;b&gt;Write a query for the following question&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The table &lt;span class="SpellE"&gt;tbl_sites&lt;/span&gt; contains the following data&lt;span class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------&lt;br /&gt;&lt;span class="SpellE"&gt;Userid&lt;/span&gt; &lt;span class="SpellE"&gt;sitename&lt;/span&gt; country&lt;br /&gt;------------------------------------------------------&lt;br /&gt;1 &lt;span class="SpellE"&gt;sureshbabu&lt;/span&gt; &lt;span class="SpellE"&gt;indian&lt;/span&gt;&lt;br /&gt;2 &lt;span class="SpellE"&gt;PHPprogrammer&lt;/span&gt; &lt;span class="SpellE"&gt;andhra&lt;/span&gt;&lt;br /&gt;3 PHP.net &lt;span class="SpellE"&gt;usa&lt;/span&gt;&lt;br /&gt;4 PHPtalk.com &lt;span class="SpellE"&gt;germany&lt;/span&gt;&lt;br /&gt;5 MySQL.com &lt;span class="SpellE"&gt;usa&lt;/span&gt;&lt;br /&gt;6 &lt;span class="SpellE"&gt;sureshbabu&lt;/span&gt; &lt;span class="SpellE"&gt;canada&lt;/span&gt;&lt;br /&gt;7 PHPbuddy.com &lt;span class="SpellE"&gt;pakistan&lt;/span&gt;&lt;br /&gt;8. PHPtalk.com &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;austria&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;9. &lt;span class="GramE"&gt;PHPfreaks.com &lt;span class="SpellE"&gt;sourthafrica&lt;/span&gt;&lt;br /&gt;10.&lt;/span&gt; PHPsupport.net &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;russia&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;11. &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;sureshbabu&lt;/span&gt;&lt;/span&gt; &lt;span class="SpellE"&gt;australia&lt;/span&gt;&lt;br /&gt;12. &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;sureshbabu&lt;/span&gt;&lt;/span&gt; &lt;span class="SpellE"&gt;nepal&lt;/span&gt;&lt;br /&gt;13. PHPtalk.com &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;italy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Write a select query that will be displayed the duplicated site name and how many times it is duplicated? … &lt;/p&gt;  &lt;p&gt;SELECT &lt;span class="SpellE"&gt;sitename&lt;/span&gt;, &lt;span class="GramE"&gt;COUNT(&lt;/span&gt;*) AS &lt;span class="SpellE"&gt;NumOccurrences&lt;/span&gt;&lt;br /&gt;FROM &lt;span class="SpellE"&gt;tbl_sites&lt;/span&gt;&lt;br /&gt;GROUP BY &lt;span class="SpellE"&gt;sitename&lt;/span&gt; HAVING COUNT(*) &gt; 1&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How &lt;span class="GramE"&gt;To&lt;/span&gt; Protect Special Characters in Query String? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;If you want to include special characters like spaces in the query string, you need to protect them by applying the &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;urlencode&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) translation function. The script below shows how to use &lt;span class="SpellE"&gt;urlencode&lt;/span&gt;():&lt;br /&gt;&lt;br /&gt;&lt;?&lt;span class="SpellE"&gt;php&lt;/span&gt;&lt;br /&gt;print("&lt;html&gt;");&lt;br /&gt;print("&lt;p&gt;Please click the links below"&lt;br /&gt;." to submit comments about FYICenter.com:&lt;/p&gt;");&lt;br /&gt;$comment = 'I want to say: "It\'s a good site! :-&gt;"';&lt;br /&gt;$comment = &lt;span class="SpellE"&gt;urlencode&lt;/span&gt;($comment);&lt;br /&gt;print("&lt;p&gt;"&lt;br /&gt;."&lt;span class="GramE"&gt;&lt;a class="SpellE"&gt;href&lt;/span&gt;=\"&lt;span class="SpellE"&gt;processing_forms.php?name&lt;/span&gt;=&lt;span class="SpellE"&gt;Guest&amp;amp;comment&lt;/span&gt;=$comment\"&gt;"&lt;br /&gt;."&lt;/span&gt;It's an excellent site&lt;span class="GramE"&gt;!&lt;&lt;/span&gt;/a&gt;&lt;/p&gt;");&lt;br /&gt;$comment = 'This visitor said: "It\'s an average site! :-("';&lt;br /&gt;$comment = &lt;span class="SpellE"&gt;urlencode&lt;/span&gt;($comment);&lt;br /&gt;print("&lt;p&gt;"&lt;br /&gt;.'&lt;a class="SpellE"&gt;href&lt;/span&gt;="&lt;span class="SpellE"&gt;processing_forms.php?'.&lt;span class="GramE"&gt;$comment&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;.'"&lt;/span&gt;&gt;'&lt;br /&gt;."It's an average site&lt;span class="GramE"&gt;.&lt;&lt;/span&gt;/a&gt;&lt;/p&gt;");&lt;br /&gt;print("&lt;/html&gt;");&lt;br /&gt;?&gt; &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;Are objects passed by value or by reference? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Everything is passed by value. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What are the differences between &lt;span class="GramE"&gt;DROP&lt;/span&gt; a table and TRUNCATE a table? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;DROP TABLE &lt;span class="SpellE"&gt;table_name&lt;/span&gt; - This will delete the table and its data.&lt;br /&gt;&lt;br /&gt;TRUNCATE TABLE &lt;span class="SpellE"&gt;table_name&lt;/span&gt; - This will delete the data of the table, but not the table definition.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;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? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-style: italic;" class="SpellE"&gt;Anwser&lt;/span&gt;&lt;span style="font-style: italic;"&gt; 1&lt;/span&gt;&lt;span style="font-style: italic;" class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When we submit a form, which has the GET method it displays pair of name/value used in the form at the address bar of the browser preceded by &lt;span class="SpellE"&gt;url&lt;/span&gt;. Post method doesn't display these values.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;" class="SpellE"&gt;Anwser&lt;/span&gt;&lt;span style="font-style: italic;"&gt; 2&lt;/span&gt;&lt;span style="font-style: italic;" class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When you want to send short or small data, not containing ASCII characters, then you can use GET” Method. But for long data sending, say more then 100 character you can use POST method.&lt;br /&gt;&lt;br /&gt;Once most important difference is when you are sending the form with GET method. You can see the output which you are sending in the address bar. Whereas if you send the form with POST” method then user can not see that information.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;" class="SpellE"&gt;Anwser&lt;/span&gt;&lt;span style="font-style: italic;"&gt; 3&lt;/span&gt;&lt;span style="font-style: italic;" class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;What are "GET" and "POST"?&lt;br /&gt;&lt;br /&gt;GET and POST are methods used to send data to the server: With the GET method, the browser appends the data onto the URL. With the Post method, the data is sent as "standard input."&lt;br /&gt;&lt;br /&gt;Major Difference&lt;br /&gt;&lt;br /&gt;In simple words, in POST method data is sent by standard input (nothing shown in URL when posting while in GET method data is sent through query string.&lt;br /&gt;&lt;br /&gt;Ex: Assume we are logging in with username and password.&lt;br /&gt;&lt;br /&gt;GET: we are submitting a form to &lt;span class="SpellE"&gt;login.php&lt;/span&gt;, when we do submit or similar action, values are sent through visible query string (notice ./&lt;span class="SpellE"&gt;login.php?username&lt;/span&gt;=...&amp;amp;password=... as URL when executing the script &lt;span class="SpellE"&gt;login.php&lt;/span&gt;) and is retrieved by &lt;span class="SpellE"&gt;login.php&lt;/span&gt; by $_&lt;span class="GramE"&gt;GET[&lt;/span&gt;'username'] and $_GET['password'].&lt;br /&gt;&lt;br /&gt;POST: we are submitting a form to &lt;span class="SpellE"&gt;login.php&lt;/span&gt;, when we do submit or similar action, values are sent through invisible standard input (notice ./&lt;span class="SpellE"&gt;login.php&lt;/span&gt;) and is retrieved by &lt;span class="SpellE"&gt;login.php&lt;/span&gt; by $_POST['username'] and $_POST['password'].&lt;br /&gt;&lt;br /&gt;POST is assumed more secure and we can send lot more data than that of GET method is limited (they say Internet Explorer can take care of maximum 2083 character as a query string).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;" class="SpellE"&gt;Anwser&lt;/span&gt;&lt;span style="font-style: italic;"&gt; 4&lt;/span&gt;&lt;span style="font-style: italic;" class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the get method the data made available to the action page ( where data is received ) by the URL so data can be seen in the address bar. Not advisable if you are sending login info like password etc. In the post method the data will be available as data blocks and not as query string in case of get method.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;" class="SpellE"&gt;Anwser&lt;/span&gt;&lt;span style="font-style: italic;"&gt; 5&lt;/span&gt;&lt;span style="font-style: italic;" class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When we submit a form, which has the GET method it pass value in the form of query string (set of name/value pair) and display along with URL. With GET we can a small data submit from the form (a set of 255 character) whereas Post method doesn't display value with URL. It passes value in the form of Object and we can submit large data from the form.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;" class="SpellE"&gt;Anwser&lt;/span&gt;&lt;span style="font-style: italic;"&gt; 6&lt;/span&gt;&lt;span style="font-style: italic;" class="GramE"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;On the server side, the main difference between GET and POST is where the submitted is stored. The $_GET array stores data submitted by the GET method. The $_POST array stores data submitted by the POST method.&lt;br /&gt;On the browser side, the difference is that data submitted by the GET method will be displayed in the browser’s address field. Data submitted by the POST method will not be displayed anywhere on the browser.&lt;br /&gt;GET method is mostly used for submitting a small amount and less sensitive data. POST method is mostly used for submitting a large amount or sensitive data. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-9043471741364779682?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/9043471741364779682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=9043471741364779682' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/9043471741364779682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/9043471741364779682'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/php-interview-questions-part5.html' title='Php interview Questions - part5'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-3660365604155191561</id><published>2008-04-14T23:34:00.000-07:00</published><updated>2008-04-14T23:35:13.375-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Php interview Questions'/><title type='text'>Php interview questions - part4</title><content type='html'>&lt;p&gt;&lt;b&gt;How can we encrypt the username and password using PHP? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Answer1&lt;br /&gt;You can encrypt a password with the following Mysql&gt;SET PASSWORD=PASSWORD ("Password");&lt;br /&gt;&lt;br /&gt;Answer2&lt;br /&gt;You can use the MySQL &lt;span class="GramE"&gt;PASSWORD(&lt;/span&gt;) function to encrypt username and password. For example&lt;span class="GramE"&gt;,&lt;/span&gt;&lt;br /&gt;INSERT into user (password, ...) VALUES (PASSWORD($password”)), ...); &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How do you pass a variable by value? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Just like in C++, put an ampersand in front of it, like $a = &amp;amp;$b &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;WHAT IS THE FUNCTIONALITY OF THE FUNCTIONS &lt;span class="GramE"&gt;STRSTR(&lt;/span&gt;) AND STRISTR()? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="GramE"&gt;string&lt;/span&gt; &lt;span class="SpellE"&gt;strstr&lt;/span&gt; ( string haystack, string needle ) returns part of haystack string from the first occurrence of needle to the end of haystack. This function is case-sensitive.&lt;br /&gt;&lt;br /&gt;&lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;stristr&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) is &lt;span class="SpellE"&gt;idential&lt;/span&gt; to &lt;span class="SpellE"&gt;strstr&lt;/span&gt;() except that it is case insensitive. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;When are you supposed to use &lt;span class="SpellE"&gt;endif&lt;/span&gt; to end the conditional statement? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;When the original if was followed &lt;span class="GramE"&gt;by :&lt;/span&gt; and then the code block without braces. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How can we send mail using JavaScript? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;No. There is no way to send emails directly using JavaScript.&lt;br /&gt;&lt;br /&gt;But you can use JavaScript to execute a client side email program send the email using the "mailto" code. Here is an example:&lt;br /&gt;&lt;br /&gt;function &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;myfunction&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;form)&lt;br /&gt;{&lt;br /&gt;&lt;span class="SpellE"&gt;tdata&lt;/span&gt;=document.myform.tbox1.value;&lt;br /&gt;location="&lt;span class="SpellE"&gt;mailto:mailid@domain.com?subject&lt;/span&gt;=...";&lt;br /&gt;return true;&lt;br /&gt;}&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What is the functionality of the function &lt;span class="SpellE"&gt;strstr&lt;/span&gt; and &lt;span class="SpellE"&gt;stristr&lt;/span&gt;? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;strstr&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) returns part of a given string from the first occurrence of a given substring to the end of the string. For example: &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;strstr&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;"user@example.com","@") will return "@example.com".&lt;br /&gt;&lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;stristr&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) is &lt;span class="SpellE"&gt;idential&lt;/span&gt; to &lt;span class="SpellE"&gt;strstr&lt;/span&gt;() except that it is case insensitive. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;What is the difference between &lt;span class="SpellE"&gt;ereg_&lt;span class="GramE"&gt;replace&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) and &lt;span class="SpellE"&gt;eregi_replace&lt;/span&gt;()? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;eregi_&lt;span class="GramE"&gt;replace&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) function is identical to &lt;span class="SpellE"&gt;ereg_replace&lt;/span&gt;() except that it ignores case distinction when matching alphabetic characters. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How do I find out the number of parameters passed into &lt;span class="GramE"&gt;function9.&lt;/span&gt; ? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="SpellE"&gt;func_num_&lt;span class="GramE"&gt;args&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;(&lt;/span&gt;) function returns the number of parameters passed in. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;What is the purpose of the following files having extensions: &lt;span class="SpellE"&gt;frm&lt;/span&gt;, &lt;span class="SpellE"&gt;myd&lt;/span&gt;, and &lt;span class="SpellE"&gt;myi&lt;/span&gt;? What these files contain? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;In MySQL, the default table type is &lt;span class="SpellE"&gt;MyISAM&lt;/span&gt;.&lt;br /&gt;Each &lt;span class="SpellE"&gt;MyISAM&lt;/span&gt; table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type.&lt;br /&gt;&lt;br /&gt;The '.&lt;span class="SpellE"&gt;frm&lt;/span&gt;' file stores the table definition.&lt;br /&gt;The data file has a '.MYD' (&lt;span class="SpellE"&gt;MYData&lt;/span&gt;) extension.&lt;br /&gt;The index file has a '.MYI' (&lt;span class="SpellE"&gt;MYIndex&lt;/span&gt;) extension,&lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;If the variable $&lt;span class="GramE"&gt;a is&lt;/span&gt; equal to 5 and variable $b is equal to character a, what’s the value of $$b? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;100, it’s a reference to existing variable. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-3660365604155191561?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/3660365604155191561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=3660365604155191561' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/3660365604155191561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/3660365604155191561'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/php-interview-questions-part4.html' title='Php interview questions - part4'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-2789722927583730790</id><published>2008-04-14T23:31:00.000-07:00</published><updated>2008-04-14T23:34:29.793-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Php interview Questions'/><title type='text'>Php interview questions- part3</title><content type='html'>&lt;p&gt;&lt;b&gt;How &lt;span class="GramE"&gt;To&lt;/span&gt; Get the Uploaded File Information in the Receiving Script? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Once the Web server received the uploaded file, it will call the PHP script specified in the form action attribute to process them. This receiving PHP script can get the uploaded file information through the predefined array called $_FILES. Uploaded file information is organized in $_FILES as a two-dimensional array as:&lt;/p&gt;  &lt;ul type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;$_&lt;span class="GramE"&gt;FILES[&lt;/span&gt;$&lt;span class="SpellE"&gt;fieldName&lt;/span&gt;]['name'] - The Original file name on the      browser system.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;$_&lt;span class="GramE"&gt;FILES[&lt;/span&gt;$&lt;span class="SpellE"&gt;fieldName&lt;/span&gt;]['type'] - The file type determined by the      browser.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;$_&lt;span class="GramE"&gt;FILES[&lt;/span&gt;$&lt;span class="SpellE"&gt;fieldName&lt;/span&gt;]['size'] - The Number of bytes of the file      content.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;$_&lt;span class="GramE"&gt;FILES[&lt;/span&gt;$&lt;span class="SpellE"&gt;fieldName&lt;/span&gt;]['&lt;span class="SpellE"&gt;tmp_name&lt;/span&gt;'] - The      temporary filename of the file in which the uploaded file was stored on      the server.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;$_&lt;span class="GramE"&gt;FILES[&lt;/span&gt;$&lt;span class="SpellE"&gt;fieldName&lt;/span&gt;]['error'] - The error code associated with      this file upload.&lt;/li&gt;&lt;/ul&gt;  &lt;p&gt;The $&lt;span class="SpellE"&gt;fieldName&lt;/span&gt; is the name used in the input name="&lt;span" class="SpellE" type="FILE,"&gt;fieldName&gt;.&lt;/p&gt;&lt;b&gt;&lt;br /&gt;What is the difference between &lt;span class="SpellE"&gt;mysql_fetch_object&lt;/span&gt; and &lt;span class="SpellE"&gt;mysql_fetch_array&lt;/span&gt;? &lt;/b&gt;  &lt;p&gt;MySQL fetch object will collect first single matching record where &lt;span class="SpellE"&gt;mysql_fetch_array&lt;/span&gt; will collect all matching records from the table in an array.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;How can I execute a PHP script using command line? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Just run the PHP CLI (Command Line Interface) program and provide the PHP script file name as the command line argument. For example, "&lt;span class="SpellE"&gt;php&lt;/span&gt; &lt;span class="SpellE"&gt;myScript.php&lt;/span&gt;", assuming "&lt;span class="SpellE"&gt;php&lt;/span&gt;" is the command to invoke the CLI program.&lt;br /&gt;Be aware that if your PHP script was written for the Web CGI interface, it may not execute properly in command line environment. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;PHP Interpreter treats numbers beginning with 0 as octal. Look at the similar PHP interview questions for more numeric problems. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;span class="GramE"&gt;&lt;b&gt;Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example?&lt;/b&gt;&lt;/span&gt;&lt;b&gt; &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;In this example it wouldn’t matter, since the variable is all by itself, but if you were to print something like "{$a}&lt;span class="GramE"&gt;,000,000&lt;/span&gt; &lt;span class="SpellE"&gt;mln&lt;/span&gt; dollars", then you definitely need to use the braces. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;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 &lt;span class="GramE"&gt;employee(&lt;/span&gt;&lt;span class="SpellE"&gt;eno&lt;/span&gt; &lt;span class="SpellE"&gt;int&lt;/span&gt;(2),&lt;span class="SpellE"&gt;ename&lt;/span&gt; &lt;span class="SpellE"&gt;varchar&lt;/span&gt;(10))? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Total 5 types of tables we can create&lt;br /&gt;1. &lt;span class="SpellE"&gt;&lt;span class="GramE"&gt;MyISAM&lt;/span&gt;&lt;/span&gt;&lt;span class="GramE"&gt;&lt;br /&gt;2.&lt;/span&gt; &lt;span class="GramE"&gt;Heap&lt;br /&gt;3.&lt;/span&gt; Merge&lt;br /&gt;4. &lt;span class="GramE"&gt;INNO DB&lt;br /&gt;5.&lt;/span&gt; ISAM&lt;br /&gt;&lt;span class="SpellE"&gt;MyISAM&lt;/span&gt; is the default storage engine as of MySQL 3.23. When you fire the above create query MySQL will create a &lt;span class="SpellE"&gt;MyISAM&lt;/span&gt; table. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;  &lt;/p&gt;   &lt;p&gt;&lt;b&gt;How &lt;span class="GramE"&gt;To&lt;/span&gt; Create a Table? &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;If you want to create a table, you can run the CREATE TABLE statement as shown in the following sample script:&lt;br /&gt;&lt;br /&gt;&lt;&lt;span class="GramE"&gt;?&lt;span class="SpellE"&gt;php&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;include "mysql_connection.php";&lt;br /&gt;&lt;br /&gt;$sql = "CREATE TABLE fyi_links ("&lt;br /&gt;. " id INTEGER NOT NULL"&lt;br /&gt;. ", &lt;span class="SpellE"&gt;url&lt;/span&gt; &lt;span class="GramE"&gt;VARCHAR(&lt;/span&gt;80) NOT NULL"&lt;br /&gt;. ", notes &lt;span class="GramE"&gt;VARCHAR(&lt;/span&gt;1024)"&lt;br /&gt;. &lt;span class="GramE"&gt;", counts INTEGER"&lt;br /&gt;.&lt;/span&gt; ", time TIMESTAMP DEFAULT sysdate ()"&lt;br /&gt;. ")"&lt;span class="GramE"&gt;;&lt;/span&gt;&lt;br /&gt;if (mysql_query($sql, $con)) {&lt;br /&gt;print("Table fyi_links created.\n");&lt;br /&gt;} else {&lt;br /&gt;print("Table creation failed.\n");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;mysql_close($con);&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;Remember that mysql_query() returns TRUE/FALSE on CREATE statements. If you run this script, you will get something like this:&lt;br /&gt;Table fyi_links created. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-2789722927583730790?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/2789722927583730790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=2789722927583730790' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/2789722927583730790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/2789722927583730790'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/php-interview-questions-part3.html' title='Php interview questions- part3'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-235924001602656137</id><published>2008-04-14T23:21:00.000-07:00</published><updated>2008-04-14T23:31:16.103-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Php interview Questions'/><title type='text'>Php interview questions- part2</title><content type='html'>&lt;span style="font-weight: bold;"&gt;What Is a Persistent Cookie?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A persistent cookie is a cookie which is stored in a cookie file permanently on the browser's computer. By default, cookies are created as temporary cookies which stored only in the browser's memory. When the browser is closed, temporary cookies will be erased. You should decide when to use temporary cookies and when to use persistent cookies based on their differences:&lt;br /&gt;&lt;br /&gt;   * Temporary cookies can not be used for tracking long-term information.&lt;br /&gt;   * Persistent cookies can be used for tracking long-term information.&lt;br /&gt;   * Temporary cookies are safer because no programs other than the browser can access them.&lt;br /&gt;   * Persistent cookies are less secure because users can open cookie files see the cookie values.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What does a special set of tags  do in PHP?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The output is displayed directly to the browser.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How do you define a constant?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Via define() directive, like define ("MYCONSTANT", 100);&lt;br /&gt;&lt;br /&gt;Continued from previous part...)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How To Write the FORM Tag Correctly for Uploading Files?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When users clicks the submit button, files specified in the &lt;input type="FILE..."&gt; will be transferred from the browser to the Web server. This transferring (uploading) process is controlled by a properly written &lt;form...&gt; tag as:&lt;br /&gt;&lt;br /&gt;  &lt;form action="receiving.php" method="post" enctype="multipart/form-data"&gt;&lt;/form&gt;&lt;br /&gt;&lt;br /&gt;Note that you must specify METHOD as "post" and ENCTYPE as "multipart/form-data" in order for the uploading process to work. The following PHP code, called logo_upload.php, shows you a complete FORM tag for file uploading:&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;&lt;br /&gt;  print("&lt;form action=processing_uploaded_files.php"&lt;br /&gt;&lt;br /&gt;    ." method=post enctype=multipart/form-data&gt;\n");&lt;br /&gt;&lt;br /&gt;  print("Please submit an image file a Web site logo for"&lt;br /&gt;&lt;br /&gt;    ." fyicenter.com:&lt;br /&gt;\n");&lt;br /&gt;&lt;br /&gt;  print("&lt;input type="file" name="fyicenter_logo"&gt;&lt;br /&gt;\n");&lt;br /&gt;&lt;br /&gt;  print("&lt;input type="submit"&gt;\n");&lt;br /&gt;&lt;br /&gt;  print("&lt;/form&gt;\n");&lt;br /&gt;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What are the differences between require and include, include_once?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Anwser 1:&lt;/span&gt;&lt;br /&gt;require_once() and include_once() are both the functions to include and evaluate the specified file only once. If the specified file is included previous to the present call occurrence, it will not be done again.&lt;br /&gt;&lt;br /&gt;But require() and include() will do it as many times they are asked to do.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Anwser 2:&lt;/span&gt;&lt;br /&gt;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 difference being that if the code from a file has already been included, it will not be included again. The major difference between include() and require() is that in failure include() produces a warning message whereas require() produces a fatal errors.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Anwser 3:&lt;/span&gt;&lt;br /&gt;All three are used to an include file into the current page.&lt;br /&gt;If the file is not present, require(), calls a fatal error, while in include() does not.&lt;br /&gt;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 difference being that if the code from a file has already been included, it will not be included again. It des not call a fatal error if file not exists. require_once() does the same as include_once(), but it calls a fatal error if file not exists.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Anwser 4:&lt;/span&gt;&lt;br /&gt;File will not be included more than once. If we want to include a file once only and further calling of the file will be ignored then we have to use the PHP function include_once(). This will prevent problems with function redefinitions, variable value reassignments, etc.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What is meant by urlencode and urldecode?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Anwser 1:&lt;/span&gt;&lt;br /&gt;urlencode() returns the URL encoded version of the given string. URL coding converts special characters into % signs followed by two hex digits. For example: urlencode("10.00%") will return "10%2E00%25". URL encoded strings are safe to be used as part of URLs.&lt;br /&gt;urldecode() returns the URL decoded version of the given string.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Anwser 2:&lt;/span&gt;&lt;br /&gt;string urlencode(str) - Returns the URL encoded version of the input string. String values to be used in URL query string need to be URL encoded. In the URL encoded version:&lt;br /&gt;&lt;br /&gt;Alphanumeric characters are maintained as is.&lt;br /&gt;Space characters are converted to "+" characters.&lt;br /&gt;Other non-alphanumeric characters are converted "%" followed by two hex digits representing the converted character.&lt;br /&gt;&lt;br /&gt;string urldecode(str) - Returns the original string of the input URL encoded string.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;For example:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;$discount ="10.00%";&lt;br /&gt;$url = "http://domain.com/submit.php?disc=".urlencode($discount);&lt;br /&gt;echo $url;&lt;br /&gt;&lt;br /&gt;You will get "http://domain.com/submit.php?disc=10%2E00%25".&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-235924001602656137?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/235924001602656137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=235924001602656137' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/235924001602656137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/235924001602656137'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/php-interview-questions-part2.html' title='Php interview questions- part2'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-6974740425155488071</id><published>2008-04-14T23:19:00.000-07:00</published><updated>2008-04-14T23:21:50.497-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Php interview Questions'/><title type='text'>Php interview questions - part 1</title><content type='html'>&lt;span style="font-weight: bold;"&gt;What's PHP ?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What Is a Session? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests.&lt;br /&gt;&lt;br /&gt;There is only one session object available to your PHP scripts at any time. Data saved to the session by a script can be retrieved by the same script or another script when requested from the same visitor.&lt;br /&gt;&lt;br /&gt;Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete functional transaction for the same visitor.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What is meant by PEAR in php? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Answer1:&lt;/span&gt;&lt;br /&gt;PEAR is the next revolution in PHP. This repository is bringing higher level programming to PHP. PEAR is a framework and distribution system for reusable PHP components. It eases installation by bringing an automated wizard, and packing the strength and experience of PHP users into a nicely organised OOP library. PEAR also provides a command-line interface that can be used to automatically install "packages"&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Answer2:&lt;/span&gt;&lt;br /&gt;PEAR is short for "PHP Extension and Application Repository" and is pronounced just like the fruit. The purpose of PEAR is to provide:&lt;br /&gt;A structured library of open-sourced code for PHP users&lt;br /&gt;A system for code distribution and package maintenance&lt;br /&gt;A standard style for code written in PHP&lt;br /&gt;The PHP Foundation Classes (PFC),&lt;br /&gt;The PHP Extension Community Library (PECL),&lt;br /&gt;A web site, mailing lists and download mirrors to support the PHP/PEAR community&lt;br /&gt;PEAR is a community-driven project with the PEAR Group as the governing body. The project has been founded by Stig S. Bakken in 1999 and quite a lot of people have joined the project since then.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How can we know the number of days between two given dates using PHP? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Simple arithmetic:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;$date1 = date('Y-m-d');&lt;br /&gt;$date2 = '2006-07-01';&lt;br /&gt;$days = (strtotime() - strtotime()) / (60 * 60 * 24);&lt;br /&gt;echo "Number of days since '2006-07-01': $days";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How can we repair a MySQL table? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The syntex for repairing a mysql table is:&lt;br /&gt;&lt;br /&gt;REPAIR TABLE tablename&lt;br /&gt;REPAIR TABLE tablename QUICK&lt;br /&gt;REPAIR TABLE tablename EXTENDED&lt;br /&gt;&lt;br /&gt;This command will repair the table specified.&lt;br /&gt;If QUICK is given, MySQL will do a repair of only the index tree.&lt;br /&gt;If EXTENDED is given, it will create index row by row.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What is the difference between $message and $$message? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Anwser 1:&lt;/span&gt;&lt;br /&gt;$message is a simple variable whereas $$message is a reference variable. Example:&lt;br /&gt;$user = 'bob'&lt;br /&gt;&lt;br /&gt;is equivalent to&lt;br /&gt;&lt;br /&gt;$holder = 'user';&lt;br /&gt;$$holder = 'bob';&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Anwser 2:&lt;/span&gt;&lt;br /&gt;They are both variables. But $message is a variable with a fixed name. $$message is a variable who's name is stored in $message. For example, if $message contains "var", $$message is the same as $var.&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-6974740425155488071?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/6974740425155488071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=6974740425155488071' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/6974740425155488071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/6974740425155488071'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/04/php-interview-questions-part-1.html' title='Php interview questions - part 1'/><author><name>Venki</name><uri>http://www.blogger.com/profile/01176558860837653184</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_WyKWV__JEfU/SqDW76OkIvI/AAAAAAAACr4/_nE903oWdsg/S220/venki.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-2338417689622967612</id><published>2008-03-21T20:00:00.000-07:00</published><updated>2008-03-21T20:02:09.287-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tech'/><title type='text'>What is MySQL?</title><content type='html'>MySQL(pronounced          "My ess cue el") is an open source Relational Database Management          System that uses Structured Query Language. Information is stored in "Tables"          which can be thought of as the equivalent of Excel spreadsheets. A single          MySQL database can contain many tables at once and store thousands of          individual records. It's fast, reliable and flexible.&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-2338417689622967612?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/2338417689622967612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=2338417689622967612' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/2338417689622967612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/2338417689622967612'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/03/what-is-mysql.html' title='What is MySQL?'/><author><name>venke</name><uri>http://www.blogger.com/profile/14427432237996405340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-1208470381543407482</id><published>2008-03-21T19:44:00.000-07:00</published><updated>2008-03-21T20:03:35.547-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tech'/><title type='text'>What is CMS?</title><content type='html'>A content management system (CMS) is a computer software system for organizing and facilitating collaborative creation of documents and other content. A content management system is frequently a web application used for managing websites and web content, though in many cases, content management systems require special client software for editing and constructing articles. The market for content management systems remains fragmented, with many open-source and proprietary solutions available&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-1208470381543407482?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/1208470381543407482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=1208470381543407482' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/1208470381543407482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/1208470381543407482'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/03/what-is-cms.html' title='What is CMS?'/><author><name>venke</name><uri>http://www.blogger.com/profile/14427432237996405340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4298559868793267373.post-9092726833311101939</id><published>2008-03-21T19:38:00.000-07:00</published><updated>2008-03-21T20:05:18.959-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tech'/><title type='text'>What Is PHP?</title><content type='html'>&lt;p&gt;PHP is now officially known as “PHP: HyperText Preprocessor”. It is a server-side scripting language usually written in an HTML context. Unlike an ordinary HTML page, a PHP script is not sent directly to a client by the server; instead, it is parsed by the PHP binary or module, which is server-side installed. HTML elements in the script are left alone, but PHP code is interpreted and executed. PHP code in a script can query databases, create images, read and write files, talk to remote servers - the possibilities are endless. The output from PHP code is combined with the HTML in the script and the result sent to the user?s web-browser, therefore it can never tell the user whether the web-server uses PHP or not, because all the browser sees is HTML.&lt;/p&gt; &lt;p&gt;PHP’s support for Apache and MySQL further increases its popularity. Apache is now the most-used web-server in the world, and PHP can be compiled as an Apache module. MySQL is a powerful free SQL database, and PHP provides a comprehensive set of functions for working with it. The combination of Apache, MySQL and PHP is all but unbeatable.&lt;/p&gt; &lt;p&gt;That doesn?t mean that PHP cannot work in other environments or with other tools. In fact, PHP supports an extensive list of databases and web-servers. The rise in popularity of PHP has coincided with a change of approach in web-publishing. While in the mid-1990s it was ok to build sites, even relatively large sites, with hundreds of individual hard-coded HTML pages, today?s webmasters are making the most of the power of databases to manage their content more effectively and to personalize their sites according to individual user preferences.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;hi this is feeds&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4298559868793267373-9092726833311101939?l=phpjavanet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://phpjavanet.blogspot.com/feeds/9092726833311101939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4298559868793267373&amp;postID=9092726833311101939' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/9092726833311101939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4298559868793267373/posts/default/9092726833311101939'/><link rel='alternate' type='text/html' href='http://phpjavanet.blogspot.com/2008/03/what-is-php.html' title='What Is PHP?'/><author><name>venke</name><uri>http://www.blogger.com/profile/14427432237996405340</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
