All India Exams
Home AptitudeBankEngineeringEnglishGKInterviewOnline TestPlacement PapersReasoning
  • Home
  • Aptitude
  • Bank
  • Engineering
  • English
  • GK
  • Interview
  • Online Test
  • Placement Papers
  • Reasoning

Strings & Regular Expressions Questions And Answers

Here you can find Strings & Regular Expressions Questions and Answers.

Why Strings & Regular Expressions Questions and Answers Required?

In this Strings & Regular Expressions Questions and Answers section you can learn and practice Strings & Regular Expressions Questions and Answers to improve your skills in order to face technical inerview conducted by organisations. By Practicing these interview questions, you can easily crack any Exams interview.

Where can I get Strings & Regular Expressions Questions and Answers?

AllIndiaExams provides you lots Strings & Regular Expressions Questions and Answers with proper explanation. Fully solved examples with detailed answer description. All students, freshers can download Strings & Regular Expressions Questions and Answers as PDF files and eBooks.

How to solve these Strings & Regular Expressions Questions and Answers?

You no need to worry, we have given lots of Strings & Regular Expressions Questions and Answers and also we have provided lots of FAQ's to quickly answer the questions in the Competitive Exams interview.

Strings & Regular Expressions Questions and Answers

1. How many functions does PHP offer for searching and modifying strings using Perl-compatible regular expressions.

Strings & Regular Expressions Questions and Answers

2. Say we have two compare two strings which of the following function/functions can you use? (i) strcmp() (ii) strcasecmp() (iii) strspn() (iv) strcspn()

Strings & Regular Expressions Questions and Answers

3. Which one of the following functions will convert a string to all uppercase?

Strings & Regular Expressions Questions and Answers

4. What will be the output of the following PHP code? < ?php $title = "O'malley wins the heavyweight championship!"; echo ucwords($title); ?>

Strings & Regular Expressions Questions and Answers

5. What will be the output of the following PHP code? < ?php echo str_pad("Salad", 5)." is good."; ?>

Strings & Regular Expressions Questions and Answers

6. Which one of the following functions can be used to concatenate array elements to form a single delimited string?

Strings & Regular Expressions Questions and Answers

7. Which one of the following functions finds the last occurrence of a string, returning its numerical position?

Strings & Regular Expressions Questions and Answers

8. What will be the output of the following PHP code? < ?php $url = "nachiketh@example.com"; echo ltrim(strstr($url, "@"),"@"); ?>

Strings & Regular Expressions Questions and Answers

9. PHP has long supported two regular expression implementations known as ___ and ___. (i) Perl (ii) PEAR (iii) Pearl (iv) POSIX

Strings & Regular Expressions Questions and Answers

10. Which one of the following regular expression matches any string containing zero or one p?

Home EngineeringComputer Science & EngineeringPHP Questions and AnswersStrings & Regular Expressions

Strings & Regular Expressions - PHP Questions and Answers

This is the questions and answers section on "PHP Strings & Regular Expressions" with the explanation for various interview, competitive examination and entrance test. Solved examples with detailed answer description, explanation are given and it would be easy to understand.

PHP Strings & Regular Expressions Questions

Online Test Name PHP Strings & Regular Expressions
Exam Type Multiple Choice Questions
Category Computer Science Engineering Quiz
Number of Questions 14
1. How many functions does PHP offer for searching and modifying strings using Perl-compatible regular expressions.
  • A. 7
  • B. 8
  • C. 9
  • D. 10
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option B

Explanation:

The functions are preg_filter(), preg_grep(), preg_match(), preg_match_all(), preg_quote(), preg_replace(), preg_replace_callback(), and preg_split().

Workspace

Report Error


2. Say we have two compare two strings which of the following function/functions can you use?
(i) strcmp()
(ii) strcasecmp()
(iii) strspn()
(iv) strcspn()
  • A. (i) and (ii)
  • B. (iii) and (iv)
  • C. None of the mentioned
  • D. All of the mentioned
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option D

Explanation:

All of the functions mentioned above can be used to compare strings in some or the other way.

Workspace

Report Error


3. Which one of the following functions will convert a string to all uppercase?
  • A. strtoupper()
  • B. uppercase()
  • C. str_uppercase()
  • D. struppercase()
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option A

Explanation:

Its prototype follows string

strtoupper(string str).

Workspace

Report Error


4. What will be the output of the following PHP code?
< ?php 
    $title = "O'malley wins the heavyweight championship!";
    echo ucwords($title);
?>
  • A. O'Malley Wins The Heavyweight Championship!
  • B. O'malley Wins The Heavyweight Championship!
  • C. O'Malley wins the heavyweight championship!
  • D. o'malley wins the heavyweight championship!
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option D

Explanation:

The ucwords() function capitalizes the first letter of each word in a string. Its prototype follows:string ucwords(string str)

Workspace

Report Error


5. What will be the output of the following PHP code?
< ?php 
   echo str_pad("Salad", 5)." is good.";
?>
  • A. SaladSaladSaladSaladSalad is good
  • B. is good SaladSaladSaladSaladSalad
  • C. is good Salad
  • D. Salad is good
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option D

Explanation:

The str_pad() function pads a string with a specified number of characters.

Workspace

Report Error


  • «
  • 1
  • 2
  • 3
  • »

Related Topics:

  • Object Oriented PHP
  • Arrays
  • Exception Handling
  • Variables
  • PHP Basics
  • MySQL Basics
  • HTML Forms
  • Functions

Mock Tests & Online Quizzes

  • Aptitude Online Test

  • Reasoning Online Test

  • GK Online Test

  • English Online Test

  • RRB Mock Test

  • RBI Mock Test

  • Free SBI Mock Test

  • IBPS Mock Test FREE

  • SSC Mock Test

  • CAT Exam Mock Test

  • GATE Mock Test

  • IT Courses Quiz

Questions and Answers

  • Aptitude Questions
  • Verbal Reasoning Questions
  • Non Verbal Reasoning
  • Logical Reasoning Questions
  • Data Sufficiency Questions
  • Data Interpretation
  • eLitmus Sample Papers
  • ECE Questions and Answers
  • EEE Questions and Answers
  • Verbal Ability Questions
  • GK Questions

Programming Quiz

  • C Programming
  • C++ Programming
  • PHP Programming
  • Java Programming
  • Python Programming
  • DataScience MCQ
  • Hadoop MCQ
  • Mongo DB MCQ
  • MySQL MCQ

Interview Questions

  • Java Interview Questions
  • .Net Interview Questions
  • Networking Interview Questions
  • C Language Interview Questions
  • C++ Interview Questions
  • Testing Interview Questions
  • Android Interview Questions
  • HR Interview Questions
  • Group Discussion Topics

Mock Tests

  • CAT Mock Test
  • SSC Mock Test
  • AMCAT Mock Online Test
  • LIC Mock Test
  • IBPS Mock Test
  • RRB Mock Test
  • RBI Mock Test
  • Free SBI Mock Test
© by AllIndiaExams.in. All Rights Reserved | Copyright | Terms of Use & Privacy Policy