[ create a new paste ] login | about

Link: http://codepad.org/alVyqrBm    [ raw code | output | fork ]

PHP, pasted on Jun 18:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
$search_array = array("123","456","789");
if (in_array('123', $search_array)) {
    echo "The 123 element is in the array";
}
else
{
   echo "The 123 element is NOT in the array";
}

if (in_array('111', $search_array)) {
    echo "- The 111 element is in the array";
}
else
{
   echo "- The 111 element is NOT in the array";
}
?>


Output:
1
The 123 element is in the array- The 111 element is NOT in the array


Create a new paste based on this one


Comments: