Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 513 Bytes

0582.md

File metadata and controls

24 lines (18 loc) · 513 Bytes

What will be the output of the below code?

$a = "PHP";
$a++;

echo $a;
  • A) PHQ
  • B) PHP
  • C) 0
  • D) 1
Answer

Answer: A

Explanation – All variables are stored using their ASCII value, so when we increment any variable the ASCII value is incremented. If we do $a++ again we will get the output as PHR.