ID: 26433
Comment by: samtheman2 at tioga dot net
Reported By: samtheman at tioga dot net
Status: Open
Bug Type: Feature/Change Request
Operating System: All
PHP Version: Irrelevant
New Comment:
function is_unique() {
$numargs = func_num_args();
$args = func_get_args();
if(count(array_unique($args)) == $numargs) {
return TRUE;
}else{
return FALSE;
}
Previous Comments:
------------------------------------------------------------------------
[2003-11-27 04:45:03] 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";
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26433&edit=1