I want to remove all 0s placed at the beginning of some variable. I'm sending
var = 93
by ajax when i echo it's 093
I tried
$exam_sn = ltrim($exam_sn, "0") ;
$exam_sn = (float)$exam_sn ;
$exam_sn = preg_replace('~^[0]*([1-9][0-9]*)$~','$1',$exam_sn) ;
doesn't work. I also tried
$exam_sn = ltrim($exam_sn, "09") ;
the value = 03