php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #15347 strtok multiple string handling
Submitted: 2002-02-03 03:47 UTC Modified: 2011-01-01 00:35 UTC
From: dave at compunexus dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.0CVS-2002-02-03 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
 [2011-01-01 00:35 UTC] jani@php.net
-Status: Open +Status: Bogus -Package: Feature/Change Request +Package: *General Issues
 [2011-01-01 00:35 UTC] jani@php.net
Incomprehensible request.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu May 08 01:01:27 2025 UTC