3
I have the following code:
$chk_selectes = $_REQUEST['chk_selectes'];
it receives via REQUEST a variable with this value: 000 or 001 or 011 or 111.
I need to check each of these elements so I used:
$um = substr("$_REQUEST['chk_selectes']", 0,1);
$dois = substr("$_REQUEST['chk_selectes']", 1,1);
$tres= substr("$_REQUEST['chk_selectes']", 2,1);
but since the value of chk_selectes is 000 and this is an int this giving error.
I tried that already:
$chk_selectes = (string) $_REQUEST['chk_selectes'];
Just one addendum: make sure the request value is a integer. When I tested with
011
he was treated like an octadecimal, turning into9
, which resulted in009
. Behold that other answer for more details.– bio