In the script below, I’m trying to dynamically set the css width attribute on the .sidebar and .content elements by subtracting the value stored in the ‘my_sidebar_width’ variable from 950
I’m getting an error:
Parse error: syntax error, unexpected
T_DNUMBER
if(get_option('my_sidebar_width') !=='')
$my_stringData .=
".sidebar{width:".get_option('my_sidebar_width')."}
.content{width:".950-get_option('my_sidebar_width')."}";
This is my first foray into calculating values in PHP. Do I need to explicitly convert the ‘my_sidebar_width’ variable to an integer? Perhaps more?
Try to put the substraction in parantheses, like this: