Answer the question
In order to leave comments, you need to log in
Why does explode in php give wrong result (different length of strings in resulting array)?
I am finishing the site on modx - there is a special construction that emulates if in the template.
I could not get it to work and I got into the code.
Inside there is approximately the following design (simplified for understanding)
$opers = explode(":is:", "8:is:8");
return $opers[0] == $opers[1];
array(2) {
[0]=>
string(14) "8"
[1]=>
string(1) "8"
}
var_dump($is);
string(20) "8:ieq:8"
var_dump(explode(":ieq:",$is));
array(2) {
[0]=>
string(14) "8"
[1]=>
string(1) "8"
}
var_dump(bin2hex($is));
string(40) "5b2b6e6f6d696e6174696f6e2b5d3a6965713a38"
var_dump($is);
string(20) "8:ieq:8"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question