php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #15348 strtok multiple string handling
Submitted: 2002-02-03 03:47 UTC Modified: 2002-02-10 00:09 UTC
Votes:1
Avg. Score:2.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: dave at compunexus dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.0CVS-2002-02-0 OS: mandrake 8.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dave at compunexus dot com
New email:
PHP Version: OS:

 

 [2002-02-03 03:47 UTC] dave at compunexus dot com
just a quick example of one think I'd like to do, I 
figured out why it was failing, it was just toking the 
last string twice instead of each string once.  I suspect 
it would require an extra parameter, but I'd like the 
feature anyways....

Thanks

$field_display_tok = strtok ( "$field_display", ',' );
  $field_val_tok = strtok ( "$field_val", ',' );
 
  // still need to set type properly
  while ( $field_display_tok && $field_val_tok )
  {
//    printf ( "field_edval:  $field_edval, fieldval_tok:  
$fieldval_tok\n");
    if ( $field_edval == $field_val_tok )
      printf ( "    <option value = \"" . 
$field_display_tok . "\" selected>" . $field_display_tok . 
"\n" );
    else
      printf ( "    <option value = \"" . 
$field_display_tok . "\">" . $field_display_tok . "\n" );
 
    $field_display_tok = strtok(",");
    $field_val_tok = strtok(",");
     printf ( "field_edval:  $field_edval, fieldval_tok:  
$field_val_tok\n");
  }

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-10 00:09 UTC] jimw@php.net
Please do not submit the same bug more than once.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 20:01:46 2025 UTC