print_r($pages);
print max($pages);
print min($pages);
shows me
Array ( [0] => 1 [1] => 2 [2] => 3 ) 1 2
While I was expecting the last two numbers to be 3 and 1. How come?
EDIT: further info
$pages = $v->plaintext;
var_dump($pages);
$exp = explode("|", $pages);
print_r($exp);
print max($exp);
gives
string(324) " 1 | 2 | 3 " Array ( [0] => 1 [1] => 2 [2] => 3 ) 1
Not sure what the "string(324) is? It's still outputting "1" as the max($exp) ...
EDIT: found solution, I was dealing with strings. This now works and prints out 3.
$pages = $v->plaintext;
$exp = explode("|", $pages);
$exp = array_map("trim", $exp);
$exp = array_map("intval", $exp);
print max($exp);