我真的不喜欢我对格林纳达的经验,但我认为这是一个学习曲线。 有些人看着我的法典,让我知道,我的htmltag子为什么不为我的一些班子展示?
$g_books = array();
$g_elem = null;
function startElement( $parser, $name, $attrs )
{
global $g_books, $g_elem;
if ( $name == AFFILIATEXML )
{
$g_books []= array();
}
$g_elem = $name;
}
function endElement( $parser, $name )
{
global $g_elem;
$g_elem = null;
}
function textData( $parser, $text )
{
global $g_books, $g_elem;
if ( $g_elem == PRODUCTID ||
$g_elem == PRODUCTNAME ||
$g_elem == PRODUCTPRICE ||
$g_elem == CLASS_DATE ||
$g_elem == LONGDESCRIPTION )
{
$g_books[ count( $g_books ) - 1 ][ $g_elem ] = $text;
}
}
$parser = xml_parser_create();
xml_set_element_handler( $parser, "startElement", "endElement" );
xml_set_character_data_handler( $parser, "textData" );
$f = fopen( http://webinars.knowledgewave.com/xml/1033499.xml , r );
while( $data = fread( $f, 4096 ) )
{
xml_parse( $parser, $data );
}
xml_parser_free( $parser );
//start table code
foreach( $g_books as $book )
{
if ($book[ CLASS_DATE ] == ON DEMAND )
{
$bb = $book[ LONGDESCRIPTION ];
$b = html_entity_decode($bb);
echo "<tr><td>";
echo "<table border=0>";
echo"<tr><td><a id= ".$book[ PRODUCTID ]."link href= javascript:showDetails(".$book[ PRODUCTID ].") >".$book[ PRODUCTNAME ]."</a></td></tr>";
echo "<tr><td id= ".$book[ PRODUCTID ]." style= font-size: 18px; height: 20px; display: block; >".$bb."dd</td></tr>";
echo "</table></td>";
echo"<td>N/A</td>";
echo"<td><a href= http://members.logontolearn.com/amember/signup.php >WATCH NOW</a></td>";
echo"</tr>";
}
}
//end table code;