Fri, 17 May 2024


How to tokenize a string?

By: Nathalie, NetArt Media
Sat, 28 November 2020

You may use the special PHP function strtok

<?php

$myText="online pharmacy web solution";

$strToken=strtok($myText," ");

while($strToken)

{

echo $strToken."<br>";

$strToken=strtok(" ");

}

?>


Category: PHP Examples
Share this post:



See All Scripts






Subscribe for our newsletter

Receive the latest blog posts direct in your mailbox