πŸ“Š PHP
Q. What is the result of the following PHP code?
Code:
<?php
    $username = "Alex";
    if (preg_match("([^a-z])",$username))
        echo "Username must be all lowercase!";
    else
        echo "Username is all lowercase!";
?>
  • (A) Error
  • (B) Username must be all lowercase!
  • (C) Username is all lowercase!
  • (D) No Output
πŸ’¬ Discuss
βœ… Correct Answer: (B) Username must be all lowercase!

Explanation: The built-in function preg_match() returns whether a match was found in a string.

Explanation by: Akshay Kulkarni
The built-in function preg_match() returns whether a match was found in a string.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
159
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Akshay Kulkarni
Publisher
πŸ“ˆ
81%
Success Rate