Xtremer360 Posted March 12, 2012 Share Posted March 12, 2012 Really not seeing where my missing parenthesis goes. if(isset($this->uri->segment(3)) AND ((empty($this->uri->segment(3))||($this->uri->segment(3) === FALSE)||(trim($this->uri->segment(3)) == ''))) Link to comment https://forums.phpfreaks.com/topic/258764-missing-or/ Share on other sites More sharing options...
scootstah Posted March 12, 2012 Share Posted March 12, 2012 Tip: use an editor with bracket highlighting and you'll be able to easily see. However, you have too many parenthesis. You can rewrite this as such: if(isset($this->uri->segment(3)) && (empty($this->uri->segment(3)) || $this->uri->segment(3) === false || trim($this->uri->segment(3)) == '')) Link to comment https://forums.phpfreaks.com/topic/258764-missing-or/#findComment-1326524 Share on other sites More sharing options...
dragon_sa Posted March 12, 2012 Share Posted March 12, 2012 Theres 12 opening brackets and 11 closing brackets, there are too many but the missing 1 in that statement is on the end Link to comment https://forums.phpfreaks.com/topic/258764-missing-or/#findComment-1326527 Share on other sites More sharing options...
xyph Posted March 12, 2012 Share Posted March 12, 2012 if( isset($this->uri->segment(3)) && empty($this->uri->segment(3)) || $this->uri->segment(3) === FALSE || trim($this->uri->segment(3)) == '' ) To help you solve these on your own, you should try writing long conditionals like this if( isset($this->uri->segment(3)) && empty($this->uri->segment(3)) || $this->uri->segment(3) === FALSE || trim($this->uri->segment(3)) == '' ) { // whatever } or something similar that makes them easier to read. Link to comment https://forums.phpfreaks.com/topic/258764-missing-or/#findComment-1326530 Share on other sites More sharing options...
Xtremer360 Posted March 12, 2012 Author Share Posted March 12, 2012 I'm getting this error: Fatal error: Can't use method return value in write context in /home/xtremer/public_html/kowmanager/application/controllers/pmsystem.php on line 95 which is the line in question Link to comment https://forums.phpfreaks.com/topic/258764-missing-or/#findComment-1326531 Share on other sites More sharing options...
scootstah Posted March 12, 2012 Share Posted March 12, 2012 Are you using CodeIgniter? The segment method returns false by default if there is no segment. So all you'd need to do to check if a segment exists is: if ($this->uri->segment(3)) Link to comment https://forums.phpfreaks.com/topic/258764-missing-or/#findComment-1326599 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.