Php Syntax Error Unexpected T_double_arrow
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company syntax error, unexpected '=>' (t_double_arrow) laravel Business Learn more about hiring developers or posting ads with us Stack Overflow Questions syntax error unexpected t_double_arrow in codeigniter Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million syntax error, unexpected '=>' (t_double_arrow) yii2 programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Parse error: syntax error, unexpected T_DOUBLE_ARROW PHP [closed] up vote 3 down vote favorite 1 I'm getting a Parse error: syntax
Unexpected >
error, unexpected T_DOUBLE_ARROW PHP on line 47, which is 'post_content' => $thisShow['content'], Anyone got any ideas why? protected function _saveShow($thisShow) { $saveData = array( 'mid' => $this->_saveAsUserId, 'post_title' => $thisShow['title'], 'post_name' => slug($thisShow['title'], 'post_content' => $thisShow['content'], 'post_date' => date('Y-m-d H:i:s'), 'post_date_gmt' => date('Y-m-d H:i:s'), 'category_id' => 4, 'post_author' => 0, 'category_name' => $thisShow['category_name'] ); // $this->_database->insert('wp_posts', $saveData); } php arrays syntax-error share|improve this question edited Apr 12 '10 at 14:11 Gumbo 396k64548668 asked Apr parse error in php 12 '10 at 14:05 Belgin Fish 4,4222570106 closed as too localized by HamZa, andrewsi, Sindre Sorhus, Maerlyn, danodonovan Jun 20 '13 at 10:36 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question. add a comment| 1 Answer 1 active oldest votes up vote 13 down vote accepted you didn't close your parenthesis on the prior line: 'post_name' => slug($thisShow['title']), share|improve this answer edited Nov 28 '11 at 18:37 answered Apr 12 '10 at 14:07 GSto 18.4k25104160 thanks a bunch :D –Belgin Fish Apr 12 '10 at 15:33 just to be clear, I think you mean it should read 'post_name' => slug($thisShow['title']), with the last parenthesis on the end there, is that right? –Sam Murray-Sutton Nov 24 '11 at 15:10 1 thanks @SamMurray-Sutton for pointing that out. fixed. –GSto Nov 28 '11 at 18:37 add a comment| Not the answer you're looking for? Browse other questions tagged php arrays syntax-error or ask your own ques
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more syntax error, unexpected '[', expecting ')' about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users
Parse Error Syntax Error Unexpected '= '
Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping
Append To Array Php
each other. Join them; it only takes a minute: Sign up unexpected T_DOUBLE_ARROW [closed] up vote 0 down vote favorite Hi I'm getting an unexpected T_DOUBLE_ARROW on line 13. I know it seems like quite a complicated set of http://stackoverflow.com/questions/2622624/parse-error-syntax-error-unexpected-t-double-arrow-php arrays but it needs yo be like this. There are probably more errors later on also. Please could someone explain my mistake. Thanks array( ($LibraryStatus ? array("wLibrary" => array("title" => "Library", "display" => "")) : false), ($ControlStatus ? ("wControl" => array("title" => "Control", "display" => "")) : false)), "section2" => array( ($HDDStatus ? array("whdd" => array("title" => "HDD", "display" => "")) : http://stackoverflow.com/questions/6674917/unexpected-t-double-arrow false))); ?> php arrays share|improve this question asked Jul 13 '11 at 6:30 Michael 1863414 closed as too localized by cryptic ツ, Lusitanian, rdlowrey, tereško, X.L.Ant Mar 21 '13 at 9:14 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question. 2 Hooooo boy. Php really needs to be taken out back and shot between the eyeballs. –eggonlegs Oct 11 '12 at 17:07 add a comment| 2 Answers 2 active oldest votes up vote 8 down vote Missing array here: ($ControlStatus ? ("wControl" => ... Should be: ($ControlStatus ? array("wControl" =>... share|improve this answer answered Jul 13 '11 at 6:32 searlea 4,29221626 Is there any way to write it without having an array there? I need control and library to be part of the array by array("wLibrary". –Michael Jul 13 '11 at 6:33 It's not possible to use the ternary to control whether a key=>value pair should be included or excluded, but you might be able to use array_merge or create unions with + &ndas
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company http://stackoverflow.com/questions/21515692/parse-error-unexpected-t-double-arrow-whats-wrong Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, http://forums.oscommerce.com/topic/302523-parse-error-syntax-error-unexpected-t-double-arrow/ just like you, helping each other. Join them; it only takes a minute: Sign up Parse error unexpected t_double_arrow what's wrong? up vote -2 down vote favorite array_push($data, $_POST['username'] =>array("url" =>"uploadedfiles/" . $_FILES['file']['name'] ,"pass"=>$_POST['password'])); This is the syntax error line that the error occurs on, is there something I'm doing wrong? php share|improve this question asked Feb 2 '14 at 20:20 user3079557 4 There is a syntax error in your code. => can only be used under certain circumstances (array, foreach). What are you trying to achieve? –Bugs Feb 2 '14 at 20:25 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote You can not do syntax error unexpected the way you are trying. If I understood you are setting $_POST["username"] with some array value and then pushing into an array and if so the correct way should be $_POST['username'] = array ( "url" =>"uploadedfiles/" . $_FILES['file']['name'] , "pass"=>$_POST['password'] ); array_push($data, $_POST['username']); array_push is used to push element in existing array http://in2.php.net/manual/en/function.array-push.php Here is an example how it works $data =array("kk"); array_push($data, array("a","b")); print_r($data); output :: Array ( [0] => kk [1] => Array ( [0] => a [1] => b ) ) share|improve this answer edited Feb 2 '14 at 20:49 answered Feb 2 '14 at 20:29 Abhik Chakraborty 37.1k41737 Warning: array_push() expects parameter 1 to be array, null given –user3079557 Feb 2 '14 at 20:39 what is ur $data array ? does it contain anything if not then u will get this error. –Abhik Chakraborty Feb 2 '14 at 20:40 $data=array("user1"=>array("url"=>"user1.pphp","password"=>"pass1"), "user2"=>array("url"=>"user2.php","password"=>"pass2"), "user3"=>array("url"=>"user3.php", "password"=>"pass3")); –user3079557 Feb 5 '14 at 17:05 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're