Help with array

Started on the old forum in October 2011 · view the original in the archive · old links redirect here

2 replies · 307 views · started 15 years ago · 1 min read

3 participants
jaidon20k Developer · 64 posts #1
function test($type)
{
$ary = array("text","password","checkbox","radio","submit");
if($type !== $ary)
{
echo "that type is not supported";
}
echo "$type";
}

pls what is worry with the array() above. If i call test("text"); it work, but telling me that that type is not supported.

Kuchi Junior · 11 posts #3

Here solution:

<?
//By C0ol
function test($type)
{
$ary = array("text","password","checkbox","radio","submit");

if(!in_array($type,$ary))
{
echo "that type is not supported";
}

echo $type;
}  

echo "<br />";

test(text);

?>

Who i m doesnt matter

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close