0

I keep getting the following syntax error: Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in C:\xampp\xampp\htdocs\xampp\getFriends.php on line 26

I'm hoping some fresh eyeballs on this will help. I've been puzzling through it for the better part of the day and I'll be doggone if I can find the error...

17:// check for success or failure 18:if (empty($buffer)) { 19: echo 'Error'; 20:} else { 21: echo '<h1>Success Connate</h1><hr>'; 22:} 23: echo $buffer 24: 25:// copy buffer to a csv file 26:$list = ob_get_contents( ); 27: $fp = fopen(file.csv, x); 28:foreach ("$list" as $line) { 29: fputcsv($fp, split(',', $line)); 30:} 31: 32:?>[code=php]
17:// check for success or failure
18:if (empty($buffer)) {
19: echo 'Error';
20:} else {
21: echo '<h1>Success Connate</h1><hr>';
22:}
23: echo $buffer
24:
25:// copy buffer to a csv file
26:$list = ob_get_contents( );
27: $fp = fopen(file.csv, x);
28:foreach ("$list" as $line) {
29: fputcsv($fp, split(',', $line));
30:}
31:
32:?>

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by rrothfeldt
0

Hi rrothfeldt,

When you get this type of error, look at the few lines above the line mentioned.
In this case, you missed out a semicolon on line 23

23: echo $buffer;


Zagga

0

Hi rrothfeldt,

When you get this type of error, look at the few lines above the line mentioned.
In this case, you missed out a semicolon on line 23

23: echo $buffer;


Zagga

Thanks, Zagga! Yep, that fixed it.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.