CodeIgniter Forums

Full Version: Newbie, problem with parse error unexpected T_CONSTANT_ENCAPSED_STRING
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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

El Forum

[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,

El Forum

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

El Forum

[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>\"";    '

El Forum

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

El Forum

[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>';