With the piece of PHP code I have been working on, I wanted to return only:
value1
value2
of an array.
However when I run this code, it returns the following:
value1
value2
value2
value2
value2
This is my code:
<?php
$inputname = array("value1", "value2", "value3", "value4", "value5");
foreach($inputname AS $i){
if($i == "value1" || $i = "value2")
{
echo($i."<br />");
}
}
?>
Am I overlooking something?