|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-11-27 04:45 UTC] samtheman at tioga dot net
Description:
------------
Would like to see a function for comparing strings. is_unique() seems to be open.
Ability to compare more than 2 strings for uniqueness, if they are not unique false is returned, else true.
$choice1 = "yes";
$choice2 = "no";
$choice3 = "maybe";
$choice4 = "no";
if(is_unique($choice1,$choice2,$choice3,$choice4)){
echo "yes";
}else{
echo "no";
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 01:00:02 2025 UTC |
function is_unique() { $numargs = func_num_args(); $args = func_get_args(); if(count(array_unique($args)) == $numargs) { return TRUE; }else{ return FALSE; }