I posted here because this isnt strictly a web design problem but hoping you can help (or point me in the right direction).
Im writting a PHP script to display data on a userbar which works
The problem is that im wanting to move $userbar_text into a config file but cant get embedded $xa of $x to parse correctly.
So the above in short has become:-
config.inc.php
script.php
but whatever I try, userbar displays either the text "Checked : 3 $xa of $x work" without changing $xa or $x or "Checked : 3 of work" with the variables being blank.
Im writting a PHP script to display data on a userbar which works
PHP:
$userbar_text = "Checked : 1 $xa of $x work";
imagestring($im, $font, 125, 3, $userbar_text, $colour);
The problem is that im wanting to move $userbar_text into a config file but cant get embedded $xa of $x to parse correctly.
So the above in short has become:-
config.inc.php
PHP:
$rsdata = array(
// id img cl1 cl2 cl3 fnt x y "text"
array( "001", "001", 0, 0, 0, 3, 125, 3, "Checked : 1 \$xa of \$x work"),
array( "002", "002", 0, 0, 0, 3, 125, 3, "Checked : 2 \$xa of \$x work"),
array( "003", "003", 0, 0, 0, 3, 125, 3, "Checked : 3 \$xa of \$x work"),
);
script.php
PHP:
require_once('includes/config.inc.php');
...
...
foreach ($rsdata as $i => $tempvalue) {
if ($imgnum == $rsdata[$i][0]) {
$userbar_text = $tempvalue[8];
$colour = imagecolorallocate($im, $tempvalue[2], $tempvalue[3], $tempvalue[4]);
ImageFill($im, 0, 0, $grey);
imagestring($im, $tempvalue[5], $tempvalue[6], $tempvalue[7], $userbar_text, $colour);
}
}
but whatever I try, userbar displays either the text "Checked : 3 $xa of $x work" without changing $xa or $x or "Checked : 3 of work" with the variables being blank.