php - Just want to compare last 5 characters of strings in array -
i check last 5 character of string data inside array. default how check it, couldn't substr because second parameter array.
if(in_array($row_order->number, $exploded_results[$row_order->log]){ please advise. thanks.
i'm assuming value of $exploded_results[$row_order->log] array - try this, it's not pretty should work.
$found = false; foreach ( $exploded_results[$row_order->log] $item ) { if ( substr( $item, -5 ) == $row_order->number ) { $found = true; break; } } if ( $found ) { ... } you may need more precise in substr check in case mixing types in if check using ===.
hope helps.
Comments
Post a Comment