$NewEmail

"; $Email = "joe@gmail.com"; $NameEnd = strpos($Email, "@"); // returns 3 because joe@gmail has 3 letters before the @ symbol. echo "

$NameEnd

"; // This replaces everything before the @ symbol in the address. $NewEmail = substr_replace($Email, "vice.president", 0, $NameEnd); // Displays vice.president@gmail.com echo "

$NewEmail

"; $FirstStudyPublisher = "American Medical Association"; // Searches for the first empty string in the $FirstStudyPublisher string and assigns it to the $MiddleTermStart // variable and then adds 1 to make up for the empty space. Returns 9. echo "

$FirstStudyPublisher

"; $MiddleTermStart = strpos($FirstStudyPublisher, " ") + 1; echo '$MiddleTermStart value: ' . "$MiddleTermStart

"; // Searches for the first empty string from the end of the $FirstStudyPublisher string and then subtracts the // value of the $MiddleTermStart. Returns 7. $MiddleTermEnd = strrpos($FirstStudyPublisher, " ") - $MiddleTermStart; echo '

$MiddleTermEnd value: ' . "$MiddleTermEnd

"; // Puts the string "heart in between the 9th and 7th place in the text string." $SecondStudyPublisher = substr_replace($FirstStudyPublisher, "Heart", $MiddleTermStart, $MiddleTermEnd); echo "

The first study was published by the $FirstStudyPublisher

\n"; echo "

The second study was published by the $SecondStudyPublisher

\n"; ?>