Please see this bit of code:
$sentence = 'Lucas and Amanjot were dancing in the streets.';
$pos = strpos($sentence, "dancing");
echo($sentence) . "<br />";
echo("The word dancing is in the following position: $pos");
Instead of assigning the strpos() function to a variable, is there a way to put it into the echo statement directly? I tried a few times and wasn't getting anywhere. It didn't seem that it was recognizing that it was a function instead of text. However, I thought the double " instead of ' would parse it correctly. And further to this point, functions within other functions (within other, other, other functions) work the same way?
Thoughts?
Thanks again for all the clarification and help!


Sign In
Create Account


Back to top









