<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>php interview questions and answers&#187; Php Interview Questions and answers</title>
	<atom:link href="http://www.phpinterviewquestions.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpinterviewquestions.com</link>
	<description>we help you in preparing for your next interview with high confidence in php technical stuff</description>
	<lastBuildDate>Thu, 02 Sep 2010 11:16:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>back to the basics</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/back-to-the-basics/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/back-to-the-basics/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 10:38:24 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[basics]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=363</guid>
		<description><![CDATA[



This is just a quick note about how you must prepare for your technical interview whether it&#8217;s a face to face or a written.
Before you prepare for a technical interview you must re-work on your basics in the first place. if you are not sure enough don&#8217;t go to the interview. Prepare well for your [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 336x280, created 3/4/10 */
google_ad_slot = "4291231574";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>This is just a quick note about how you must prepare for your technical interview whether it&#8217;s a face to face or a written.<br />
Before you prepare for a technical interview you must re-work on your basics in the first place. if you are not sure enough don&#8217;t go to the interview. Prepare well for your next interview. It will help you a lot  <img src='http://www.phpinterviewquestions.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>For an instance at least work on following aspects,</p>
<ul>
<li><strong>Client Server</strong>  &#8211; &gt; What is client server architecture? Basic requesting methods to the server?</li>
<li><strong>Sessions</strong>  -&gt; What is a session? Where sessions are stored? How session reference is carried in the browser(client) side?</li>
<li><strong>OOP</strong>     -&gt; What is a class? what is overloading? what is overriding and how you do these with examples?</li>
<li><strong>XML</strong>    -&gt; What is xml? and what&#8217;s the use of it?</li>
<li><strong>AJAX</strong> -&gt; What is ajax? if you use 3rd party tool at least know the basic functions.</li>
<li><strong>Frameworks</strong> &#8211; &gt; Design patterns used? MVC? Explain cakephp, zend etc</li>
<li><strong>CMS</strong>-&gt; At least the knowledge of integrating a template. Joomla, Drupal, Magento</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/back-to-the-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sessions and cookies</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/sessions-and-cookies/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/sessions-and-cookies/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 10:51:35 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[Regular level]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php security]]></category>
		<category><![CDATA[sessions]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=338</guid>
		<description><![CDATA[



Face to face technical interviews, questions related to sessions and cookies will pop up regularly. Since most of the developers are familiar with these sort of basic php questions they tend to ask more tricky questions, but if you have the correct idea then it is easy to answer any of those tricky questions. Let&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 336x280, created 3/4/10 */
google_ad_slot = "4291231574";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Face to face technical interviews, questions related to sessions and cookies will pop up regularly. Since most of the developers are familiar with these sort of basic php questions they tend to ask more tricky questions, but if you have the correct idea then it is easy to answer any of those tricky questions. Let&#8217;s have a look on potential questions,</p>
<dl>
<dt>Where is the sessions are stored?</dt>
<dd>Sessions are stored in server side and it is accessed by a unique id which is known as the session-id where each user/visitor is assigned when they access your website.</dd>
<dt>How the session-id is propagated within your website?</dt>
<dd>Basically, there are 2 methods either <strong>store it in a cookie</strong> or <strong>propagated in the URL</strong>. </dd>
</dl>
<p>Session security questions will not be asked in an entry level interviews but, if an advanced level candidate who has experience in developing robust and secured application must know about the vulnerabilities.</p>
<p>Leaking out an existing session-id to a third party is very risky if the session is filled with more important information.<br />
Main two methods of vulnerabilities are,<br />
- When the session-id is carrying in URLs<br />
If an external link from your site, a URL with the id might be stored in the external site&#8217;s referrer log.</p>
<p>- Active attacker might listen to network traffic<br />
While the session-id flows over the network and if it is not encrypted an active listener might grab it. The best solution is to implement SSL and make it a must for all the users.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/sessions-and-cookies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oral php interview questions</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/oral-php-interview-questions/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/oral-php-interview-questions/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 10:39:12 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[interviews]]></category>
		<category><![CDATA[oop]]></category>
		<category><![CDATA[sessions]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=334</guid>
		<description><![CDATA[



Here is a list of php question areas that might be asked in an add-hoc oral technical interview.
First of all they will focus on some more basic questions,
- Difference between GET and POST
- Echo and print
- Language constructors and so on&#8230;
Then most likely they would focus on,
- The behaviors of sessions and cookies
- Ways of [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 336x280, created 3/4/10 */
google_ad_slot = "4291231574";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Here is a list of php question areas that might be asked in an add-hoc oral technical interview.</p>
<p>First of all they will focus on some more basic questions,<br />
- Difference between GET and POST<br />
- Echo and print<br />
- Language constructors and so on&#8230;</p>
<p>Then most likely they would focus on,<br />
- The behaviors of sessions and cookies<br />
- Ways of a session ID can be passed<br />
- Db connection strings and how can it be centralized and stuff like that.<br />
- Difference between normal connection and a persistent connection etc..</p>
<p>Then obviously the interviewer will have to asses on your knowledge in Object Oriented Programming techniques,<br />
- Simply what is a class or object?<br />
- Some definitions on OOP techniques like, Encapsulation, overloading, inheritance.</p>
<p>Also design pattern questions will be asked here.<br />
- Which OOP pattern implements a class that must be instantiated only once in a life span of a script?<br />
- Some more questions on design patterns mostly real world scenarios.<br />
- How design patterns can be used as a mix of more than one pattern?<br />
- Some more discussions related to MVC, Abstract factory, and singleton.</p>
<p>Last but not least they will focus on your knowledge about the security issues, best practices, probably about register global issues and so on. Then the interviewers will focus on more into your CV and about the Frameworks and CMS&#8217;s you have been exposed to.</p>
<p>We will be discussing all of above points one by one in later posts stay tuned.</p>
<p>Cheers !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/oral-php-interview-questions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php security interview questions</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/php-security-interview-questions/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/php-security-interview-questions/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 11:11:55 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[php security]]></category>
		<category><![CDATA[register global]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=327</guid>
		<description><![CDATA[



Consider the following code snippet. Is this code acceptable from a security standpoint?
Assume that the $action and $data variables are designed to be accepted from the user and
register_globals is enabled.

&#60;?php
if(isUserAdmin()) {
 $isAdmin = true;
}
$data = validate_and_return_input($data);
switch($action){
 case 'add':
 addSomething($data);
 break;
case 'delete':
 if($isAdmin) {
 deleteSomething($data);
 }
break;
case 'edit':
 if($isAdmin) {
 editSomething($data);
 }
break;
default:
print “Bad Action.”;
}
?&#62;

A. Yes, it is [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 336x280, created 3/4/10 */
google_ad_slot = "4291231574";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Consider the following code snippet. Is this code acceptable from a security standpoint?<br />
Assume that the $action and $data variables are designed to be accepted from the user and<br />
register_globals is enabled.</p>
<pre class="brush: php;">
&lt;?php
if(isUserAdmin()) {
 $isAdmin = true;
}
$data = validate_and_return_input($data);
switch($action){
 case 'add':
 addSomething($data);
 break;
case 'delete':
 if($isAdmin) {
 deleteSomething($data);
 }
break;
case 'edit':
 if($isAdmin) {
 editSomething($data);
 }
break;
default:
print “Bad Action.”;
}
?&gt;
</pre>
<p>A. Yes, it is secure. It checks for $isAdmin to be True before executing protected operations<br />
B. No, it is not secure because it doesn’t make sure $action is valid input<br />
<strong>C. No, it is not secure because $isAdmin can be hijacked by exploiting register_globals</strong><br />
D. Yes, it is secure because it validates the user-data $data<br />
E. Both A and B</p>
<p>The correct answer is C. This code is, by any means, not secure! In fact, it is the classic security exploit of PHP scripts using the register_globals configuration directive. The problem lies in the $isAdmin variable: although this is clearly a Boolean value, it is only set in the event that the user is an Admin and not set at all if the user is not. Because register_globals is enabled, by simply appending that variable to the end of the URL as a GET parameter, a malicious user could easily impersonate an administrator:</p>
<p>http://www.example.com/action.php?action=delete&#038;data=foo&#038;isAdmin=1</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/php-security-interview-questions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Blue print of an object</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/blue-print-of-an-object-php/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/blue-print-of-an-object-php/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 12:02:36 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[Regular level]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=324</guid>
		<description><![CDATA[What is the construct used to define the blueprint of an object called?
A class is a blueprint of an object, which is an instance of a class. 




]]></description>
			<content:encoded><![CDATA[<p>What is the construct used to define the blueprint of an object called?</p>
<p>A class is a blueprint of an object, which is an instance of a class. </p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 468x15, created 4/16/10 */
google_ad_slot = "1994287074";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/blue-print-of-an-object-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>why cakephp? interview question</title>
		<link>http://www.phpinterviewquestions.com/framework-php-interview-questions/why-cakephp-interview-question/</link>
		<comments>http://www.phpinterviewquestions.com/framework-php-interview-questions/why-cakephp-interview-question/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 06:24:17 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Framework questions]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[cakephp interview]]></category>
		<category><![CDATA[Interview]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=320</guid>
		<description><![CDATA[In an interview the interviewer asked,
Why we use cakephp? We can just have our own structure and keep developing projects without making things more complicated. Why cake?
The best answer for this question from the cakephp Cookbook is,


		

		

		
We don&#8217;t have to re-invent the wheel. Every time we sit for a new project, we have a more [...]]]></description>
			<content:encoded><![CDATA[<p>In an interview the interviewer asked,</p>
<blockquote><p>Why we use cakephp? We can just have our own structure and keep developing projects without making things more complicated. Why cake?</p></blockquote>
<p>The best answer for this question from the cakephp Cookbook is,</p>
<p><script type="text/javascript"><!--

		google_ad_client = "pub-8695027799979044";

		/* 468x15, created 3/2/10 */

		google_ad_slot = "0865002888";

		google_ad_width = 468;

		google_ad_height = 15;

		//-->

		</script>

		<script type="text/javascript"

		src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

		</script></p>
<p>We don&#8217;t have to re-invent the wheel. Every time we sit for a new project, we have a more structural way of developing the project with an already installed development environment and we just have to start our rapid application straight a way with the business logic.</p>
<p>Some of the key features the framework provides are,<br />
- MVC structure<br />
- Code generation<br />
- CRUD for database interaction<br />
- Application scaffolding<br />
- Code generation<br />
- Built-in validation<br />
- Data sanitation<br />
- Flexible casching<br />
- Localization</p>
<p>and lot <a href="http://book.cakephp.org/view/8/What-is-CakePHP-Why-Use-it" target="_blank">more&#8230;&#8230;&#8230;</a></p>
<p><code>Our primary goal is to enable you to work in a structured and rapid manner–without loss of flexibility</code> &#8211; by cakephp org.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/framework-php-interview-questions/why-cakephp-interview-question/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MVC structure- cakephp</title>
		<link>http://www.phpinterviewquestions.com/framework-php-interview-questions/mvc-structure-cakephp-interview/</link>
		<comments>http://www.phpinterviewquestions.com/framework-php-interview-questions/mvc-structure-cakephp-interview/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 12:12:10 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Framework questions]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[cakephp interview]]></category>
		<category><![CDATA[mvc]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=313</guid>
		<description><![CDATA[



What is meant by MVC (Model View Controller)?
MODEL VIEW CONTROLLER, is a software architecture, currently considered an architectural pattern used in software engineering.
This isolates business logic from presentation logic.
1. The Model represents the application data
2. The View renders a presentation of model data
3. The Controller handles and routes requests made by the client
]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 336x280, created 3/4/10 */
google_ad_slot = "4291231574";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>What is meant by MVC (Model View Controller)?</p>
<p>MODEL VIEW CONTROLLER, is a software architecture, currently considered an architectural pattern used in software engineering.<br />
This isolates business logic from presentation logic.</p>
<p>1. The Model represents the application data<br />
2. The View renders a presentation of model data<br />
3. The Controller handles and routes requests made by the client<br /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/framework-php-interview-questions/mvc-structure-cakephp-interview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strings and regular expressions</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/strings-and-regular-expressions-php-interview-questions/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/strings-and-regular-expressions-php-interview-questions/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 12:08:03 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[Regular level]]></category>
		<category><![CDATA[Interview]]></category>
		<category><![CDATA[Regex]]></category>
		<category><![CDATA[Strings]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=284</guid>
		<description><![CDATA[What will be the answer of the following code snippet?

echo 'Testing ' . 1 + 2 . '45';

Simply you will give the answer as : Testing 345
But the answer is  : 245
That is because you can not sum a number with a string. The first part, before the plus mark is a string though [...]]]></description>
			<content:encoded><![CDATA[<p>What will be the answer of the following code snippet?</p>
<pre class="brush: php;">
echo 'Testing ' . 1 + 2 . '45';
</pre>
<p>Simply you will give the answer as : Testing 345</p>
<p>But the answer is  : 245</p>
<p>That is because you can not sum a number with a string. The first part, before the plus mark is a string though there is 1 there.<br />
So engine will simply get it as 0 and the latter part as 245. so answer will be 245.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 336x280, created 3/4/10 */
google_ad_slot = "4291231574";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/strings-and-regular-expressions-php-interview-questions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>String Concatenation and regular expressions</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/string-concatenation-and-regular-expressions/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/string-concatenation-and-regular-expressions/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 12:08:24 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[Regular Expressions]]></category>
		<category><![CDATA[Strings]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=273</guid>
		<description><![CDATA[Following question were asked in a technical php interview question paper
Which of the following will not combine strings $s1 and $s2 into a single string?

$s1 = 'a';
$s2 = 'b';
A. $s1 + $s2
B. "{$s1}{$s2}"
C. $s1.$s2
D. implode('', array($s1,$s2))
E. All of the above combine the strings
You can not concatenate 2 string using &#8220;+&#8221;. The answer will be &#8220;0&#8243;; [...]]]></description>
			<content:encoded><![CDATA[<p>Following question were asked in a technical php interview question paper</p>
<p>Which of the following <strong>will not</strong> combine strings $s1 and $s2 into a single string?</p>
<blockquote><p><code><br />
$s1 = 'a';<br />
$s2 = 'b';<br />
A. $s1 + $s2<br />
B. "{$s1}{$s2}"<br />
C. $s1.$s2<br />
D. implode('', array($s1,$s2))<br />
E. All of the above combine the strings</code></p></blockquote>
<p>You can not concatenate 2 string using &#8220;+&#8221;. The answer will be &#8220;0&#8243;; so here the answer is A.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 336x280, created 3/4/10 */
google_ad_slot = "4291231574";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/string-concatenation-and-regular-expressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strings and Regular Expressions</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/strings-and-regular-expressions/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/strings-and-regular-expressions/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 12:03:52 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[Strings]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=265</guid>
		<description><![CDATA[Consider the following script. What line of code should be inserted in the marked location in
order to display the string php when this script is executed?

$alpha = 'abcdefghijklmnopqrstuvwxyz';
$letters = array(15, 7, 15);
foreach($letters as $val) {
/* What should be here */
}
A. echo chr($val);
B. echo asc($val);
C. echo substr($alpha, $val, 2);
D. echo $alpha{$val};
E. echo $alpha{$val+1}

An array can be [...]]]></description>
			<content:encoded><![CDATA[<p>Consider the following script. What line of code should be inserted in the marked location in<br />
order to display the string php when this script is executed?</p>
<pre class="brush: php;">
$alpha = 'abcdefghijklmnopqrstuvwxyz';
$letters = array(15, 7, 15);
foreach($letters as $val) {
/* What should be here */
}</pre>
<p>A. echo chr($val);<br />
B. echo asc($val);<br />
C. echo substr($alpha, $val, 2);<br />
<strong>D. echo $alpha{$val};</strong><br />
E. echo $alpha{$val+1}<br />
<br />
An array can be accessed like this as well. $alpha{$val}<br />
<br />
<script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 336x280, created 3/4/10 */
google_ad_slot = "4291231574";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/strings-and-regular-expressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>heredoc syntax</title>
		<link>http://www.phpinterviewquestions.com/php-interview-questions/heredoc-syntax/</link>
		<comments>http://www.phpinterviewquestions.com/php-interview-questions/heredoc-syntax/#comments</comments>
		<pubDate>Tue, 18 May 2010 00:28:50 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Advanced level]]></category>
		<category><![CDATA[PHP Questions]]></category>
		<category><![CDATA[Strings]]></category>
		<category><![CDATA[syntax]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=256</guid>
		<description><![CDATA[&#8220;heredoc&#8221; syntax can be used to declare complex strings,
What will out put the following code snippet?
&#60;?php
$who = &#34;questions&#34;;
echo &#60;&#60;&#60;TEXT
So I said, &#34;php interview $who&#34;
TEXT;
?&#62;
Answer &#8211; So I said, &#8220;php interview questions&#8221;
In general, the functionality of this heredoc syntax is similar to double quotes. 




]]></description>
			<content:encoded><![CDATA[<p>&#8220;heredoc&#8221; syntax can be used to declare complex strings,</p>
<p>What will out put the following code snippet?</p>
<pre class="brush: php;">&lt;?php
$who = &quot;questions&quot;;
echo &lt;&lt;&lt;TEXT
So I said, &quot;php interview $who&quot;
TEXT;
?&gt;</pre>
<p>Answer &#8211; So I said, &#8220;php interview questions&#8221;</p>
<p>In general, the functionality of this heredoc syntax is similar to double quotes. </p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 468x15, created 4/16/10 */
google_ad_slot = "1994287074";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/php-interview-questions/heredoc-syntax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Taxonomy in Drupal</title>
		<link>http://www.phpinterviewquestions.com/cms-interview-questions/taxonomy-in-drupal/</link>
		<comments>http://www.phpinterviewquestions.com/cms-interview-questions/taxonomy-in-drupal/#comments</comments>
		<pubDate>Tue, 04 May 2010 11:58:21 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[CMS Questions]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[drupal]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=254</guid>
		<description><![CDATA[What is taxonomy in drupal?
We can define any number of vocabularies (category types) and terms (categories)
e.g.
Controversial Content: (vocabulary)
  &#8211; violence (term)
  &#8211; adult content (term)
Genre (Vocabulary)
 &#8211; Comedy (term)
 &#8211; Romance (term)
We can config which content types are compatible with which vocabulary and which nodes are belong to which terms.
Some important drupal modules: [...]]]></description>
			<content:encoded><![CDATA[<p>What is taxonomy in drupal?</p>
<p>We can define any number of vocabularies (category types) and terms (categories)<br />
e.g.<br />
Controversial Content: (vocabulary)<br />
  &#8211; violence (term)<br />
  &#8211; adult content (term)</p>
<p>Genre (Vocabulary)<br />
 &#8211; Comedy (term)<br />
 &#8211; Romance (term)</p>
<p>We can config which content types are compatible with which vocabulary and which nodes are belong to which terms.</p>
<p>Some important drupal modules: Views, CCK, Path auto, FCK Editor, User points, Flags, Panels, Image cache</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 336x280, created 3/4/10 */
google_ad_slot = "4291231574";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/cms-interview-questions/taxonomy-in-drupal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>drupal view module</title>
		<link>http://www.phpinterviewquestions.com/cms-interview-questions/drupal-view-module/</link>
		<comments>http://www.phpinterviewquestions.com/cms-interview-questions/drupal-view-module/#comments</comments>
		<pubDate>Sun, 02 May 2010 17:07:53 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[CMS Questions]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[drupal]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=251</guid>
		<description><![CDATA[Why View module is so important in drupal?
Views can be used to generate lists of content in various formats same as report generator works.




]]></description>
			<content:encoded><![CDATA[<p>Why View module is so important in drupal?</p>
<p>Views can be used to generate lists of content in various formats same as report generator works.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 336x280, created 3/4/10 */
google_ad_slot = "4291231574";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/cms-interview-questions/drupal-view-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>drupal user permission mechanism</title>
		<link>http://www.phpinterviewquestions.com/cms-interview-questions/drupal-user-permission-mechanism/</link>
		<comments>http://www.phpinterviewquestions.com/cms-interview-questions/drupal-user-permission-mechanism/#comments</comments>
		<pubDate>Sat, 01 May 2010 04:32:34 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[CMS Questions]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[drupal]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=239</guid>
		<description><![CDATA[What is the user permission mechanism in drupal?
We can create roles (moderators, proof readers, content admins etc) and  we can permit each task to each role. A user can have 1 or many roles.




]]></description>
			<content:encoded><![CDATA[<p>What is the user permission mechanism in drupal?</p>
<p>We can create roles (moderators, proof readers, content admins etc) and  we can permit each task to each role. A user can have 1 or many roles.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 468x15, created 4/16/10 */
google_ad_slot = "1994287074";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/cms-interview-questions/drupal-user-permission-mechanism/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is cakephp</title>
		<link>http://www.phpinterviewquestions.com/framework-php-interview-questions/what-is-cakephp/</link>
		<comments>http://www.phpinterviewquestions.com/framework-php-interview-questions/what-is-cakephp/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 10:59:46 +0000</pubDate>
		<dc:creator>Bart</dc:creator>
				<category><![CDATA[Framework questions]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[framework]]></category>

		<guid isPermaLink="false">http://www.phpinterviewquestions.com/?p=231</guid>
		<description><![CDATA[Cakephp is a framework which is used in rapid development. It provides an extensible architecture for developing, maintaining, and deploying applications using MVC (Model View Controller) and ORM(Object Relational Mapping) architectures. Helps developers, in less code and more flexibility.





]]></description>
			<content:encoded><![CDATA[<p>Cakephp is a framework which is used in rapid development. It provides an extensible architecture for developing, maintaining, and deploying applications using MVC (Model View Controller) and ORM(Object Relational Mapping) architectures. Helps developers, in less code and more flexibility.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8695027799979044";
/* 336x280, created 3/4/10 */
google_ad_slot = "4291231574";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<script type='text/javascript'><!--
//------
new YAHOO.widget.Tooltip("ttt870758326",
                           { context:"ctx_870758326",
                             text:"<p>Object Relational Mapping</p>",
                             width:"auto",
                             showDelay: 50 });
//------
//------
new YAHOO.widget.Tooltip("ttt901741260",
                           { context:"ctx_901741260",
                             text:"<p>Object Relational Mapping</p>",
                             width:"auto",
                             showDelay: 50 });
//------
//------
new YAHOO.widget.Tooltip("ttt276863544",
                           { context:"ctx_276863544",
                             text:"<p>Object-relational mapping (ORM, O/RM, and O/R mapping) in computer software is a programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages. This creates, in effect, a \"virtual object database\" that can be used from within the programming language.</p>",
                             width:"auto",
                             showDelay: 50 });
//------
//------
new YAHOO.widget.Tooltip("ttt288044949",
                           { context:"ctx_288044949",
                             text:"<p>Object-relational mapping (ORM, O/RM, and O/R mapping) in computer software is a programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages. This creates, in effect, a \"virtual object database\" that can be used from within the programming language.</p>",
                             width:"auto",
                             showDelay: 50 });
//------
//------
new YAHOO.widget.Tooltip("ttt308094610",
                           { context:"ctx_308094610",
                             text:"<p>Object-relational mapping (ORM, O/RM, and O/R mapping) in computer software is a programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages. This creates, in effect, a \"virtual object database\" that can be used from within the programming language.</p>",
                             width:"auto",
                             showDelay: 50 });
//------
//------
new YAHOO.widget.Tooltip("ttt342016217",
                           { context:"ctx_342016217",
                             text:"<p>Object-relational mapping (ORM, O/RM, and O/R mapping) in computer software is a programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages. This creates, in effect, a \"virtual object database\" that can be used from within the programming language.</p>",
                             width:"auto",
                             showDelay: 50 });
//------
//--></script>
]]></content:encoded>
			<wfw:commentRss>http://www.phpinterviewquestions.com/framework-php-interview-questions/what-is-cakephp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->
