SysTutorials Forums QA How to get a substring at words boundaries in PHP?

Viewing 0 reply threads

    How to get a substring at words boundaries in PHP?

    For example, for a string $a = "ab cc dde ffg ff";, I would like to get its substring of length at most 7 from position 0 without breaking words. A simple substring($a, 0, 7) will break the word dde.

Viewing 0 reply threads

The forum ‘QA’ is closed to new topics and replies.

Please share if you like this post: