Created
October 13, 2018 14:43
-
-
Save EastSideCode/17870e1115587eb580cf69940898f042 to your computer and use it in GitHub Desktop.
Split a string in 2 and add a span tag to the first word
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$originalString = "Test String"; | |
$stringInParts = explode(' ', $originalString); | |
$originalString = '<span>' . $stringInParts[0] . '</span>' . Implode(" ", array_slice($stringInParts,1)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment