Error Unexpected T_double_arrow
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might syntax error unexpected t_double_arrow in php have Meta Discuss the workings and policies of this site About syntax error, unexpected '=>' (t_double_arrow) laravel Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting syntax error unexpected t_double_arrow in codeigniter 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 4.7 syntax error, unexpected '=>' (t_double_arrow) yii2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up php - syntax error, unexpected T_DOUBLE_ARROW [duplicate] up vote 0 down vote favorite This question already has an answer here: PHP Parse/Syntax Errors; and How to solve them? 10 answers how i can rid of this error?? Parse
Unexpected >
error: syntax error, unexpected T_DOUBLE_ARROW in /var/www/core/restvt.api.php on line 35 PHP Code : $datax = Array(); foreach ($inis as $key => $data){ if ($data=="mem"){ $str = number_format($ARRAY[(array_search($data.':',$ARRAY)+2)]/1024,0,',','.')." MB [ ".number_format(($ARRAY[(array_search($data.':',$ARRAY)+2)]/$ARRAY[(array_search($data.':',$ARRAY)+1)])*100,0,',','.')." % ]"; array_push($datax, "mem"=>$str); //error here, why? }else{ array_push($datax,$data=>$ARRAY[(array_search($data.':',$ARRAY)+1)]); } } $jsonr = json_encode($datax); thx alot for your help... php syntax share|improve this question edited Dec 4 '13 at 2:00 asked Dec 4 '13 at 1:50 Andi Doank 6113 marked as duplicate by Cupcake, rahilwazir, Brilliand, Divi, Shankar Damodaranphp Users with the php badge can single-handedly close php questions as duplicates and reopen them as needed. Jun 7 '14 at 2:01 This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. "mem"=>$str <--- what's this? –zerkms Dec 4 '13 at 1:53 variable string value from other array, i add for some string into it... –Andi Doank Dec 4 '13 at 1:57 add a c
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the
Php Syntax Error Unexpected
workings and policies of this site About Us Learn more about Stack parse error in php Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs syntax error, unexpected '[', expecting ')' Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join http://stackoverflow.com/questions/20365334/php-syntax-error-unexpected-t-double-arrow 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 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 http://stackoverflow.com/questions/21515692/parse-error-unexpected-t-double-arrow-whats-wrong 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 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 37k41737 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 con
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 about hiring developers or http://stackoverflow.com/questions/14014201/syntax-error-unexpected-t-double-arrow 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 4.7 million programmers, just like you, helping each other. Join them; it only https://forums.phpfreaks.com/topic/171273-solved-parse-error-syntax-error-unexpected-t-double-arrow/ takes a minute: Sign up syntax error, unexpected T_DOUBLE_ARROW [closed] up vote -3 down vote favorite how can i rid of this error Parse error: syntax error, unexpected T_DOUBLE_ARROW PHP code: $uniqueOrderCodes = array(); foreach ($checks as $check) { array_push($uniqueOrderCodes,"string" syntax error => $check); } thanx alot php arrays syntax array-push share|improve this question asked Dec 23 '12 at 19:51 Mohammad Masoudian 988 closed as not a real question by Charles, Niko, PeeHaa, Ricardo Alvaro Lohmann, bensiu Dec 24 '12 at 2:05 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the error unexpected t_double_arrow help center.If this question can be reworded to fit the rules in the help center, please edit the question. 3 Don't use array_push(). just set the key: $uniqueOrderCodes['string'] = $check; –Michael Berkowski Dec 23 '12 at 19:53 Can you look at related questions, search in Google or anything? It's parse error... –pamil Dec 23 '12 at 19:53 But since this is in a loop, you're overwriting string on every iteration! Please let us know what you are trying to acheive. –Michael Berkowski Dec 23 '12 at 19:53 2 @MohammadMasoudian That is not valid. You cannot use the same key string multiple times in the array. Do you mean that you want it to be a string type? To get what you want, you just need to append to the array and it will be numerically indexed. $uniqueOrderCodes[] = $check; –Michael Berkowski Dec 23 '12 at 19:55 1 @MohammadMasoudian PHP cannot produce an array like that. It will overwrite the string key. What web service is this? –Michael Berkowski Dec 23 '12 at 19:58 | show 6 more comments 1 Answer 1 active oldest votes up vote 2 down vote accepted No offense intended, but you should read the manual. => it is an assignment operator and is used in arrays. In the example $my_array = array('color' => 'blue'), color is the key, blue is the value (of type string) and $my_array is the var
Detected You currently have javascript disabled. Several functions may not work. Please re-enable javascript to access full functionality. [SOLVED] Parse error: syntax error, unexpected T_DOUBLE_ARROW Started by mattclements, Aug 21 2009 09:28 AM Please log in to reply 2 replies to this topic #1 mattclements mattclements Advanced Member Members 84 posts LocationLetchworth, Hertfordshire, UK Posted 21 August 2009 - 09:28 AM Hey all I am getting the following error: Parse error: syntax error, unexpected T_DOUBLE_ARROW with this code - seems like im missing something stupid! 08) && (date("d") < 15) ) { echo "selected"; }; ?> Matt Web Designer/PHP Developer/Server Admin Back to top #2 Garethp Garethp Advanced Member Members 1,026 posts LocationSydney, Australia Posted 21 August 2009 - 09:36 AM Shouldn't => be ==? I don't know much about =>, but it seems like it could be that. Also, ; does not go after } The Three Rules of Getting Assistance1. Google first2. Ask second3. Then buy me some chocolate Back to top #3 mattclements mattclements Advanced Member Members 84 posts LocationLetchworth, Hertfordshire, UK Posted 21 August 2009 - 09:41 AM Sorted it - Should be >= rather than =>=> is to do with setting arrays.Matt Web Designer/PHP Developer/Server Admin Back to top Back to PHP Coding Help · Next Unread Topic → 0 user(s) are reading this topic 0 members, 0 guests, 0 anonymous users Reply to quoted postsClear PHP Freaks → PHP Coding → PHP Coding Help Privacy Policy Forum Rules & Terms of Service · Change Theme IP.Board Mobile PHP Freaks PHP Freaks - English (USA) English (USA) PHP Freaks - English (USA) Mark Community Read Forums Members Pages Mark all as read Help Community Forum Software by IP.BoardLicensed to: PHP Freaks Sign In Use Facebook Use Twitter Need an account? Register now! Username Password I've forgotten my password Remember me This is not recommended for shared computers Sign in anonymously Don't add me to the active users list Privacy Policy