This also happens when using empty on a function return:
!empty(trim($someText)) and doSomething()
because empty is not a function but a language construct (not sure), and it only takes variables:
Right:
empty($someVar)
Wrong:
empty(someFunc())
Since PHP 5.5, it supports more than variables. But if you need it before 5.5, use trim($name) == false. From empty documentation.
You mean
if (isset($_POST[‘sms_code’]) == TRUE ) {
though incidentally you really mean
if (isset($_POST[‘sms_code’])) {