Newbie, problem with parse error unexpected T_CONSTANT_ENCAPSED_STRING

#1
[eluser]The Beginner[/eluser]
I k now this is simple for most of you but i am still a beginner. When I call the function below I get unexpected T_CONSTANT_ENCAPSED_STRING in C:\xamp\htdocs\wpapp\models\wpHeaderModel.php on line 39

[code]
function getSplashData()
{
for ($counter = 0; $counter <= 59; $counter++) {
====> this is line 39 $arr[$counter] = "\"<div style=\"height:700px; width:700px;background-color: rgb (256,256,256);\"><img /></div>\"";
}
$name = 'arr';
$jsdata['jsvar'] = array_to_js_string($arr, $name);
$return($jsdata);
}
Please Help, Thanks :-S

#2
[eluser]The Beginner[/eluser]
I am not sure what happened above but part of the line is missing,

Code:
function getSplashData()
   {
    for ($counter = 0; $counter <= 59; $counter++)
    {
    $arr[$counter] = "\"<div style=\"height:700px; width:700px;background-color:
        rgb(256,256,256);\"><img  /></div>\"";            
        }
   $name = 'arr';
   $jsdata['jsvar'] = array_to_js_string($arr, $name);
   $return($jsdata);
   }
Hopefully this will do it. Sorry,

#3
[eluser]The Beginner[/eluser]
Still missing?hj%^&*()_
Code:
$arr[$counter] = "\"<div style=\"height:700px; width:700px;background-color: rgb(256,256,256);
                    \"><img  /></div>\"";            
                }

#4
[eluser]The Beginner[/eluser]
OK, if this don't do it I will quit, sorry
No single quote in code I only added them here to try to get the code to stay put...
Code:
\"><img  /></div>\"";    '

#5
[eluser]The Beginner[/eluser]
Ok, I am confused. The code will not post, I don't know why. Sorry.

#6
[eluser]bigtony[/eluser]
You could try this for the line in question:
Code:
$arr[$counter] = '<div style="height:700px; width:700px; background-color:rgb(256,256,256);"><img /></div>';


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.