nerdexam
Zend

200-530 · Question #3750

The following code piece should print "PHP is cool", but unexpectedly, it just prints "cool". How would you correct it? echo str_replace('PHP is a pain.', 'a pain', 'cool');

Sign in or unlock 200-530 to reveal the answer and full explanation for question #3750. The question stem and answer options stay visible for context.

Strings & Patterns

Question

The following code piece should print "PHP is cool", but unexpectedly, it just prints "cool". How would you correct it? echo str_replace('PHP is a pain.', 'a pain', 'cool');

Options

  • Astr_replace('PHP is a pain.', 'cool', 'a pain');
  • Bstr_replace('a pain', 'cool', 'PHP is a pain.');
  • Cstr_replace('cool', 'a pain', 'PHP is a pain.');

Unlock 200-530 to see the answer

You've previewed enough free 200-530 questions. Unlock 200-530 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Topics

#str_replace#argument order#string replacement#search replace
Full 200-530 Practice