Infosys Certified PHP Associate
Practice with real exam-pattern questions for Infosys Certified PHP Associate. Each question includes a detailed explanation to help you understand the concept, not just memorise the answer. Try 10 questions free — no login required.
Full question bank for this exam + 1,357+ others. Cancel anytime.
Join Premium10 Infosys Certified PHP Associate practice questions with answers
Real Lex exam-pattern multiple-choice questions for the Infosys Certified PHP Associate certification. Each question includes the correct answer. The full question bank is available to Premium members.
- Question 1
State True or False:
“Constant’s value can be changed during execution”.
- ✓
True
Correct - B
False
- ✓
- Question 2
How can we enable error reporting in PHP?
- ✓
ini_set(“display_errors”, 1)
Correct - B
ini_set(“errors”, 1)
- C
ini_set(“show_errors”, 1)
- D
ini_set(“display”, 1)
- ✓
- Question 3
Bella has opened a file and read 250 characters. Now she needs to move the cursor back to the 100th character of the file. Which of the following option(s) will do this operation?
- ✓
fseek($file_pointer,-149,SEEK_CUR)
Correct - B
fseek($file_pointer,-150,SEEK_CUR)
- C
fseek($file_pointer,100)
- D
fseek($file_pointer,99)
- ✓
- Question 4
Smith needs to generate 10 unique bill ids for each of his customers starting from B101. Help him to identify the missing lines of the code to complete the bill id generation.
<?php $total_customer=10; $i=0; $start_value=101; while ( ---------- ) # LINE1 { echo "Bill ID:B".$start_value; ---------------- ; #LINE2 $i+=1; } ?>- ✓
LINE 1: $i < $total_customer
LINE 2: $start_value+=$i;
Correct - B
LINE 1: $i < $total_customer
LINE 2: $start_value +=1;
- C
LINE 1: $i <= $total_customer
LINE 2: $start_value +=1;
- D
LINE 1: $i <= $total_customer
LINE 2: $start_value +=$i;
- ✓
- Question 5
Predict the output of the below code snippet.
<?php $colors = array("red"=>10, "green"=>3, "blue"=>5, "yellow"=>20,"red"=>12,"Blue"=>5,"yellow"=>3); foreach ($colors as $keys=>$values) { echo "$keys:$values#"; } ?>- ✓
red:10#green:3#blue:5#yellow:20#red:12#Blue:5#yellow:3#
Correct - B
red:12#green:3#blue:5#yellow:3#Blue:5#
- C
$keys:$values#$keys:$values#$keys:$values#$keys:$values#$keys:$values#
- D
$keys:$values#$keys:$values#$keys:$values#$keys:$values#$keys:$values#$ keys:$values#$keys:$values#
- ✓
- Question 6
When logout.php page is executed, Peter wants to destroy the cookie "uname". Choose the appropriate code which logout.php should contain:
- ✓
<?php setcookie("uname",""); ?>
Correct - B
<?php setcookie("uname","",time()-60); ?> - C
<?php setcookie("uname",time()-60); ?> - D
<?php setcookie("",time()-60); ?>
- ✓
- Question 7
Statement 1: system() can be used to execute system level commands from the applications
Statement 2: execute() can be used to execute system level commands from the applications
Which of the above statement is/are true?
- ✓
Statement 1
Correct - B
Statement 2
- C
Both statement 1 and statement 2
- D
Neither statement 1 nor statement 2
- ✓
- Question 8
Which of the following code snippet(s) will display the $Name=Ellen.
- ✓
<?php $Name="Ellen"; echo "$Name"=$Name; ?>
Correct - B
<?php $Name="Ellen"; echo ' $Name '+=+" $Name "; ?>
- C
<?php $Name="Ellen"; echo ' $Name= "$Name" '; ?>
- D
<?php $Name="Ellen"; echo '$Name'."=".$Name; ?>
- ✓
- Question 9
Phil wants to check the size of the uploaded file and notify the user if it exceeds the given size. Which of the following option helps him to retrieve the size of the uploaded file?
<?php < form action="document.php" method="post" enctype="multipart/form-data"> < input type="file" name="doc" value=”” /> ?>
- ✓
$POST["doc","size"];
Correct - B
$POST["doc"]["size"];
- C
$FILES["doc","size"];
- D
$_FILES["doc"]["size"];
- ✓
- Question 10
What will be the output of the following PHP code?
<?php $a=5; print ($a . '>> 2 :' ."$a >> 2"); ?>
- ✓
5>> 2 :5 >> 2
Correct - B
5. >> 2 : .5>>2
- C
5 >> 2 : 1
- D
5 >> 2: $a >> 2
- ✓
More in Open Source
Infosys Certified Elasticsearch Developer
Infosys Certified PostgreSQL Associate
Infosys Certified L1 Junior Open Source Programmer
Pay once. Clear every cert this year.
One subscription, full Telegram channel access, every PDF posted during your membership.
- Full access to all 1,357+ certifications
- Monthly updated question banks
- Telegram private channel access
- Cancel anytime
- Everything in Monthly
- Save ₹2,100 vs monthly billing
- Priority answer key requests
- Best for increasing DQ score fast
- Everything in Quarterly
- Lifetime channel access — no renewals
- All future certifications included
- Priority response from admin team
Common questions, straight answers.
A monthly-updated Telegram channel where we post real exam-pattern question banks and detailed answer keys for 1,357+ Infosys Lex certifications. You join once, you get every PDF posted during your membership.
Right after payment on our Graphy page, you'll receive a private invite link to the Telegram channel. Access is instant — usually under 30 seconds.
We compile question banks from the actual Lex test pattern, sourced and verified by 180K+ community members who've recently cleared these exams. Match rate is consistently 85–95%.
Every single month. When Infosys rolls out new versions of certifications, we post updated dumps within 7–10 days. You'll see channel activity weekly.
Clearing certifications is one of the highest-weighted DQ factors. Members typically clear 3–5 certifications in their first 3 months, which moves DQ scores up by a full band.