How can I check if a value is already in an array?
Answer Posted / deep
The above answer is correct. I will just add a complete
example.
<?php
$os = array("Mac", "NT", "Irix", "Linux");
if (in_array("Irix", $os))
{
echo "Got Irix";
}
if (in_array("mac", $os))
{
echo "Got mac";
}
?>
| Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
Which parts of php are case sensitive?
What is $row in php?
What is $_ post in php?
What are sql injections, how do you prevent them and what are the best practices?
What is the difference between php4 and php5?
Is ruby on rails php?
What are the common uses of php?
What the use of var_dump()?
What are the advantages of using php?
What new features php7 has in store for us?
What are classes in php?
How to make database connection in php?
What is the current stable version of php? What advance thing in php7?
What are major variables in research?
Maine 12th ke bad 2 years ka web designing ka course kiya hai. Php me achcha hu. Ek fresher ko is field me kitna mil sakta hai ?