Want to remove duplicates in a string

Ragnorack67_at_hotmail.com
Date: 02/27/05


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

}
?>



Relevant Pages

  • Re: A note on personal corruption as a result of using C
    ... impossible to write effective string validation routines by definition ... Turing machine can be implemented in C, then any validation procedure ... in Haskell or one of the ML family of languages. ... I haven't worked in Haskell or ML, ...
    (comp.programming)
  • Re: A note on personal corruption as a result of using C
    ... impossible to write effective string validation routines by definition ... Turing machine can be implemented in C, then any validation procedure ... in Haskell or one of the ML family of languages. ... I invited a discussion of Haskell when you said that non-OO ...
    (comp.programming)
  • Re: Why is "oN%3d" so dangerous?
    ... One workaround would be to insert some non-whitespace character outside the ... string validation is the IsDangerousString method. ... > innocuous characters triggering hard-fail validations. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: On the Fly XML Validation
    ... Here is an example class that writes validation warning, validation errors and well-formedness exceptions to the console: ... Private _xml As String ... Public Property SchemaFile() As String ...
    (microsoft.public.dotnet.xml)
  • Re: FastCode IntToStr B&V posted in attachments
    ... All functions must pass validation with overflow check on/off. ... Functions must behave exactly as the RTL functions do. ... It is not allowed to use memory below the stack pointer. ... No writing in front of result string ...
    (borland.public.delphi.language.basm)