I've been trying to convert string to int in PHP to operate on it, but PHP keeps interpreting it as 0.
var_dump ($Pux); // output: string (6) "89" I have tried several ways like
(int) $Pux, intval($Pux) settype($Pux, "integer") But they all give me 0 instead of 89.
How should this be done?
intval($Pux)seems to work for me. Are you sure this is the exact code you're running?$pux = (int) $pux;, That ought to work just fine. Don't forget to checkgettype($pux);at any given time. You might be converting the type later onstring __(6)__ "89"What are the 4 invisible bytes?