Question
Starting with $string = I swear to tell the whole truth, use the substr_replace() function, to accomplish each of the following (each step should be
Starting with $string = "I swear to tell the whole truth", use the substr_replace() function, to accomplish each of the following (each step should be output to the screen and use the new string generated in the previous step):
1. Insert the word "solemnly " before the word "swear" by counting from the beginning 2. Replace the everything starting at "whole" with "no good ", counting from the end of the string 3. Remove the words "tell the" using a php function to determine that starting position 4. Insert the words "I am up", before "to" using a php function to determine the starting position
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started