The $ page parameter comes fine, for the code
return $page; exit; no problem displays options 1, 2, 3, 4, etc.
But such a code
<?php $output = ''; //return $page; //exit; switch ($page) { case '1': $output = $modx->getChunk('Mobile1'); break; case "2": $output = $modx->getChunk('Mobile2'); break; case 3: $output = $modx->getChunk('Mobile3'); break; case 0: $output = $modx->getChunk('Mobile4'); break; } return $output; in any case $ page always works only on the last line, case 0.
What is the problem? (this is ModX Revo, it is assumed that $ page comes in the $ _GET parameter)
I looked through this "1" in the hex editor. It turned out such crap:
<20><31><0D><0A><20><20><20><20><20><20><20><20> space, 1, line break and a bunch of spaces.
Now trying to screw
preg_replace('/[^0-9]/', '', $str); generally gives an empty string (
case1 `` then everything will work, or not? - teran