How would you return part of a string based on the contents of the string in php. Unlike substr() and related functions where you use an integer length
So if we are given a string like this
here is a nice string that is being used as an example
How could we return a string like this
nice string
Somehow we have to pass the function a
and that
so it knows the start and end point. It will find the first a
and then start keeping track of characters then when it finds that
it will stop, and return.
To be clear: we know the contents of the original string... and the arguments sent.