473,322 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Expecting `T_PAAMAYIM_NEKUDOTAYIM'

On line 70, I get parse error: parse error, expecting `T_PAAMAYIM_NEKUDOTAYIM' in G:\xampp\htdocs\2DArray.php on line 70.

Please help :D. I've googled for an hour and couldn't find anything to help !

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3.  
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5.  
  6.     <head>
  7.         <title> 2D Arrays </title>
  8.  
  9.         <style type="text/css">
  10.  
  11.         table {
  12.             border-width: 1px 1px 1px 1px;
  13.             border-style: outset outset outset outset;
  14.             margin-left:auto; margin-right:auto;
  15.             text-align: center;
  16.         }
  17.  
  18.         tr {
  19.  
  20.         }
  21.  
  22.         td {
  23.             border-style: solid solid solid solid;
  24.         }
  25.  
  26.         td.blue {
  27.             border-style: solid solid solid solid;
  28.             background-color: #00CCFF;
  29.         }
  30.  
  31.         td.orange {
  32.             border-style: solid solid solid solid;
  33.             background-color: #FFCC33;
  34.         }
  35.  
  36.         </style>
  37.  
  38.     </head>
  39.  
  40.     <body>
  41.  
  42. <?php
  43.  
  44. /*
  45. Printing the entire array
  46. Retrieving all the keys of the array
  47. Retrieving all values of the array
  48. Iterating and displaying the array without a for loop
  49. Sorting the array in any manner you like
  50. Splicing 3 elements to the array in the middle
  51. */
  52.  
  53.     $num[0] = 5;
  54.     $num[1] = 4;
  55.     $num[2] = 3;
  56.     $num[3] = 2;
  57.     $num[4] = 1;
  58.     $num[5] = 100;
  59.  
  60.     $asso["ACE"] = 1;
  61.     $asso["TWO"] = 2;
  62.     $asso["THREE"] = 3;
  63.     $asso["FOUR"] = 4;
  64.     $asso["FIVE"] = 5;
  65.     $asso["SIX"] = 6;
  66.  
  67.     $keys = array_keys($num);
  68.     $values = array_values($num);
  69.  
  70.     sort(&num, SORT_NUMERIC);
  71.  
  72. ?>
  73.  
  74.             <table>
  75.  
  76.                 <tr>
  77.                     <td class = "blue"> <b> Printing the entire array </b> </td>
  78.                     <td> <?php echo "$num[0]"; ?> </td>
  79.                     <td> <?php echo "$num[1]"; ?> </td>
  80.                     <td> <?php echo "$num[2]"; ?> </td>
  81.                     <td> <?php echo "$num[3]"; ?> </td>
  82.                     <td> <?php echo "$num[4]"; ?> </td>
  83.                     <td> <?php echo "$num[5]"; ?> </td>
  84.                 </tr>
  85.  
  86.                 <tr>
  87.                     <td class = "blue"> <b> Retrieving all the keys of the array </b> </td>
  88.                     <td> <?php echo "$keys[0]"; ?> </td>
  89.                     <td> <?php echo "$keys[1]"; ?> </td>
  90.                     <td> <?php echo "$keys[2]"; ?> </td>
  91.                     <td> <?php echo "$keys[3]"; ?> </td>
  92.                     <td> <?php echo "$keys[4]"; ?> </td>
  93.                     <td> <?php echo "$keys[5]"; ?> </td>
  94.                 </tr>
  95.  
  96.                 <tr>
  97.                     <td class = "blue"> <b> Retrieving all the values of the array </b> </td>
  98.                     <td> <?php echo "$values[0]"; ?> </td>
  99.                     <td> <?php echo "$values[1]"; ?> </td>
  100.                     <td> <?php echo "$values[2]"; ?> </td>
  101.                     <td> <?php echo "$values[3]"; ?> </td>
  102.                     <td> <?php echo "$values[4]"; ?> </td>
  103.                     <td> <?php echo "$values[5]"; ?> </td>
  104.                 </tr>
  105.  
  106.                 <tr>
  107.                     <td class = "blue"> <b> Iterating and displaying the array without a for loop </b> </td>
  108.                     <td> <?php echo current($num); ?> </td>
  109.                     <td> <?php echo next($num); ?> </td>
  110.                     <td> <?php echo next($num); ?> </td>
  111.                     <td> <?php echo next($num); ?> </td>
  112.                     <td> <?php echo next($num); ?> </td>
  113.                     <td> <?php echo next($num); ?> </td>
  114.                 </tr>
  115.  
  116.                 <?php
  117.                     sort(&num, SORT_NUMERIC);
  118.                 ?>
  119.  
  120.                 <tr>
  121.                     <td class = "blue"> <b> Sorting the array in any manner you like </b> </td>
  122.                     <td> <?php echo reset($num); ?> </td>
  123.                     <td> <?php echo next($num); ?> </td>
  124.                     <td> <?php echo next($num); ?> </td>
  125.                     <td> <?php echo next($num); ?> </td>
  126.                     <td> <?php echo next($num); ?> </td>
  127.                     <td> <?php echo next($num); ?> </td>
  128.                 </tr>
  129.  
  130.             </table> 
  131.  
  132.     </body>
  133.  
  134. </html>
  135.  
  136.  
  137.  
Mar 13 '09 #1
3 10835
Dormilich
8,658 Expert Mod 8TB
you are missing a $ sign:
Expand|Select|Wrap|Line Numbers
  1. sort(&$num, SORT_NUMERIC);
PS: 'T_PAAMAYIM_NEKUDOTAYIM' means "::" (double colon)
Mar 13 '09 #2
TheServant
1,168 Expert 1GB
Edit:: Nevermind. Was curious how you knew that but then tried google and it's all over there.
Mar 13 '09 #3
aw crap. i was programming late at night and mistook & for $.

thanks a lot !!!!!!!!!!!!!!
Mar 14 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: entoone | last post by:
I'm getting the following error Parse error: parse error, expecting `','' or `';'' in /home/notarywe/public_html/php/update2.php on line 108 Here is line 108 <input type="text" name="ud_first"...
7
by: Neil Zanella | last post by:
OK, this time the compiler's got me a little bit puzzled, simply because it is doing something I am not expecting. My understanding, according to the documentation of std::vector<>::resize(), is...
11
by: MackS | last post by:
I've come across the following difficulty, related to questions 6.12, 6.13 and 6.18 in the FAQ, which I am unable to overcome: void fun(char **array_of_strings, int num_elements); int...
0
by: Frank Skare | last post by:
Hello, can anyone tell me why I get always the following error: expecting a type specification near "CLSID" this is the definition where the error occurs: typedef struct { CLSID Clsid; ...
2
by: Zenobia | last post by:
Hi, Below is a bit of code from ASP.NET Unleashed which gives an error and I can't figure out why. It uses the Authors table from the standard Pubs database. The error message is...
8
by: The Cool Giraffe | last post by:
I'm playing around with pointers trying to figure out how the operator & works. My impression was that it can be used to create a pointer to a thingy. So, i created the following code and ran it....
5
by: Anna MZ | last post by:
I am new to php and have written the following mysql code to enter the details of a new user in the admin subdomain of my website: $sql = "INSERT INTO 'users' ('userid', 'username', 'upassword')...
1
by: soidariti | last post by:
database error - parse error, unexpected $, expecting kEND AddUserAuthorisationToUsers.rb migration file 1. class AddUserAuthorisationToUsers < ActiveRecord::Migration 2. def self.up ...
4
kestrel
by: kestrel | last post by:
I have some html code that is supposed to be displayed by php echo. But for some reason i keep getting a syntax error, and i cant figure out what is going on. Heres what i have <?php...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.