I've following array:
Array
(
[0] => class="amount">€39,00
[2] => class="subscription-details">
[4] => für
[5] => 1
[6] => month
)
I want to check if the sixth element of the value is "month".
I use this code:
print_r($test[6]); //Output month
if($test[6] == 'month'){
echo 'Alex'; //should output
}else{
echo 'Ecke'; //will output
}
Why this code will output "Ecke" and not "Alex"?
Edit:
var_dump($test[6])
outputs = string(12)
var_export($test[6])
outputs = 'month'
var_export($test) =
<pre>array (
0 => '<span',
1 => 'class="amount">€39,00</span>',
2 => '<span',
3 => 'class="subscription-details">',
4 => 'für',
5 => '1',
6 => 'month</span>',
)</pre>