Want to remove duplicates in a string
Ragnorack67_at_hotmail.com
Date: 02/27/05
- Next message: NurAzije: "Re: IBM Goes Gonzo Now for PHP!"
- Previous message: Mike: "How do I get PHP5's Exception Handling to catch a fatal error?"
- Next in thread: Jan Pieter Kunst: "Re: Want to remove duplicates in a string"
- Reply: Jan Pieter Kunst: "Re: Want to remove duplicates in a string"
- Reply: Janwillem Borleffs: "Re: Want to remove duplicates in a string"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 Feb 2005 13:01:30 -0800
Hello again, I have one further question about improving a validation.
Currently this will validate a string of words separated by commas, and
if it's greater than 9 will do something, or something else if less
than 9. How can I improve this, so before it does the checking remove
any duplicates in the string?
<?
$tmp = explode(',',$your_str);
if (count($tmp) > 9) {
// do something
} else {
// do something else
}
?>
- Next message: NurAzije: "Re: IBM Goes Gonzo Now for PHP!"
- Previous message: Mike: "How do I get PHP5's Exception Handling to catch a fatal error?"
- Next in thread: Jan Pieter Kunst: "Re: Want to remove duplicates in a string"
- Reply: Jan Pieter Kunst: "Re: Want to remove duplicates in a string"
- Reply: Janwillem Borleffs: "Re: Want to remove duplicates in a string"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|