PHP ARRAY PROBLEM!!
Posted: Thu Aug 28, 2008 9:10 am
Hello i am tryin to declare an array in a php document that will be looped through displaying only the specified elements that i want from an php xml generated file, only thing is i can't get the dman thing working!!
the array is declared in a .property doc and i am tryin to pull the array in to the php file
this is a section of the code from the php doc.
$a=array($config["group1.projects"]);
if( $rss === true )
{
echo "<item>\n<title>${f_name}, ${lResult}</title>\n";
# echo "<description>${status}.</description>\n";
echo "<description>${lResult}</description>\n";
echo "<pubDate>".($lAttempt !== "" ? date(DATE_RFC2822, $lastAttempt) : "")."</pubDate>\n";
echo "<link>".$config["url.prefix"]."?project=".
urlencode($f_name)."&log=".$lLog."</link>\n";
echo "</item>\n";
}
else foreach ($a as $z)
if ($z == $f_name) /*fname is the location of the corressponding file name
{
echo "<group1>";
echo "<project><name>".$f_name."</name><status>${status}</status>";
echo "<latestresult>".$lResult."</latestresult>";
echo "<latestsuccess>".$lSuccessfulBuild."</latestsuccess>";
echo "<latestattempt>".($lAttempt !== "" ? date($config["dateformat"], $lastAttempt) : "")."</latestattempt>";
echo "<latestlabel>".$lLabel."</latestlabel>";
echo "<latestlog>".$lLog."</latestlog>";
echo "</project>\n";
echo "</group1>";
this is the declaration in the .property doc.
group1.projects = "bnrClientConsole", "bnrCtlDotNet", "bnrCtlW32", "bnrFlash"
group1.name = PC Software
the array is declared in a .property doc and i am tryin to pull the array in to the php file
this is a section of the code from the php doc.
$a=array($config["group1.projects"]);
if( $rss === true )
{
echo "<item>\n<title>${f_name}, ${lResult}</title>\n";
# echo "<description>${status}.</description>\n";
echo "<description>${lResult}</description>\n";
echo "<pubDate>".($lAttempt !== "" ? date(DATE_RFC2822, $lastAttempt) : "")."</pubDate>\n";
echo "<link>".$config["url.prefix"]."?project=".
urlencode($f_name)."&log=".$lLog."</link>\n";
echo "</item>\n";
}
else foreach ($a as $z)
if ($z == $f_name) /*fname is the location of the corressponding file name
{
echo "<group1>";
echo "<project><name>".$f_name."</name><status>${status}</status>";
echo "<latestresult>".$lResult."</latestresult>";
echo "<latestsuccess>".$lSuccessfulBuild."</latestsuccess>";
echo "<latestattempt>".($lAttempt !== "" ? date($config["dateformat"], $lastAttempt) : "")."</latestattempt>";
echo "<latestlabel>".$lLabel."</latestlabel>";
echo "<latestlog>".$lLog."</latestlog>";
echo "</project>\n";
echo "</group1>";
this is the declaration in the .property doc.
group1.projects = "bnrClientConsole", "bnrCtlDotNet", "bnrCtlW32", "bnrFlash"
group1.name = PC Software