williamZanelli Posted July 1, 2008 Share Posted July 1, 2008 Hi guys, my knowledge of PHP is formative - I have the code $lfield1 = array(); I want to create an empty array. I get the following error Parse error: syntax error, unexpected T_ARRAY in /home/fhlinux14/p21e.php(745) : eval()'d code on line 113 Am I not allowed to creat empty arrays? ??? ??? ??? Thanks Will Link to comment https://forums.phpfreaks.com/topic/112790-solved-empty-array/ Share on other sites More sharing options...
lemmin Posted July 1, 2008 Share Posted July 1, 2008 I would guess you are missing a semi-colon on the line directly above that. Link to comment https://forums.phpfreaks.com/topic/112790-solved-empty-array/#findComment-579278 Share on other sites More sharing options...
williamZanelli Posted July 1, 2008 Author Share Posted July 1, 2008 The code is as below if (!(is_ array($someField))){ $lfield1 = array(); array_push($lfield1, $cat_name); }else{ ........... I've realised that i had a space in the is_array fucntion hence the problem. Thanks for the help. Will Link to comment https://forums.phpfreaks.com/topic/112790-solved-empty-array/#findComment-579314 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.