note 10500 deleted from function.strtok by nlopess

From: Date: Sun, 08 May 2005 07:48:16 +0000
Subject: note 10500 deleted from function.strtok by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-89111@lists.php.net to get a copy of this message
Note Submitter: mxq at supergamez dot hu ---- strtok () cannot always be fully replaced by explode. You may only need the first several tokens from a long string, then do not use explode to explode the whole string - you just waste time. strtok () seemed not to work when I tried to put the result into the same variable as I used for arg1 (for e.g., $strx = strtok ($strx, "."); simply made $strx be empty). This must be something with the pointer used. Use of an auxiliary string is needed so something like this $aux = strtok ($strx, "."); $strx = $aux;

« previous php.notes (#89111) next »