Parse Error 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 syntax error, unexpected '=>' (t_double_arrow) laravel workings and policies of this site About Us Learn more about Stack
Syntax Error Unexpected T_double_arrow In Codeigniter
Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs
Syntax Error, Unexpected '=>' (t_double_arrow) Yii2
Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join
Unexpected >
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 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'], php syntax error unexpected '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 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 '
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 parse error in php company Business Learn more about hiring developers or posting ads with us Stack Overflow syntax error, unexpected '[', expecting ')' Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 array_push in php million programmers, 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'])); http://stackoverflow.com/questions/2622624/parse-error-syntax-error-unexpected-t-double-arrow-php This is the 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 http://stackoverflow.com/questions/21515692/parse-error-unexpected-t-double-arrow-whats-wrong You can not do 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 te
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings http://stackoverflow.com/questions/4847094/php-parse-error-unexpected-t-double-arrow and policies of this site About Us Learn more about Stack Overflow the company 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, just like you, helping each other. Join them; it syntax error only takes a minute: Sign up PHP: Parse Error: unexpected T_DOUBLE_ARROW up vote 0 down vote favorite My code gives me the error Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting ')' line 208 I keep getting this but it looks correct? Line 208 which is the second down. array( "name" => "Colour Scheme", "desc" => "Select the colour scheme for syntax error unexpected the theme", "id" => $shortname."_color_scheme", "type" => "select", "options" => array("blue", "red", "green"), "std" => "blue"), please advise! Thanks php syntax-error share|improve this question edited Jan 31 '11 at 3:08 alex 267k129653807 asked Jan 31 '11 at 2:18 Brian 1111 1 There's no error here. Often errors can come up on a line, when the problem is actually right before it (for example missing ; at line end). Please show more of your code. –Jonah Jan 31 '11 at 2:26 add a comment| 2 Answers 2 active oldest votes up vote 3 down vote T_DOUBLE_ARROW is the token for =>, so you have one which appears somewhere the parser doesn't expect it. Besides that trailing ,, there is no error with the code you posted. share|improve this answer answered Jan 31 '11 at 2:20 alex 267k129653807 Thanks for the response. Here is some code just before and after. –Brian Jan 31 '11 at 20:53 add a comment| up vote 0 down vote Besides that trailing ,, there is no error with the code you poste