What does it mean when I can't "use method return value in write context"?
When开发者_StackOverflow中文版 I use this statement if(count($this->input->post('p_id') =0))
, I keep getting this error:
Fatal error: Can't use method return value in write context in
C:\xampp\htdocs\CI\professional_ci\application\models\MProducts.php on line 249
But when I use if(count($this->input->post('p_id')))
, it works. What does it mean I can't use method return?
In the first line you're trying to assign the value 0 to the function count. What you should use is == to test for equality.
if(count($this->input->post('p_id'))==0)
精彩评论