Check array php
Posted: Mon Dec 26, 2011 3:14 pm
I am assinging an array
than i am inserting data in it by a loop ex.
Now i want that, if a user enters A and and A is already in the array it will give him an error msg. So i want a script that gets what is stored in the variable(the button that the user chose) and than checks the array if it's already added and if it's added it displays the message.
Any body know how I can do it? I think i need to use a loop but still do not know what is the best choise.
Code: Select all
$alphabet = array();
Code: Select all
$alphabet [$i] = A;
$alphabet [$i] = B;
Any body know how I can do it? I think i need to use a loop but still do not know what is the best choise.