Ciao, ho questo codice:
<?php
$idpar= 01;
$insideitem = false;
$tag = "";
$title = "";
$description = "";
$link = "";
$id = "";
function startElement($parser, $name, $attrs) {
global $insideitem, $tag, $title, $description, $link, $id;
if ($insideitem) {
$tag = $name;
} elseif (strtolower($name) == "item") {
$insideitem = true;
}
}
function endElement($parser, $name) {
global $insideitem, $tag, $title, $description, $link, $id;
if (strtolower($name) == "item") {
if($id == $idpar) {
printf("[*]<h4>%s
",
trim($link),trim($title),trim($title));
printf("%s
",trim($description));
$title = "";
$id = "";
$description = "";
$link = "";
$insideitem = false;
}
[....]
Non capisco perchè se nell'istruzione:
if($id == $idpar) {
printf("[*]<h4>%s
",
trim($link),trim($title),trim($title));
printf("%s
",trim($description));
se invece di $idpar metto 01 funziona se faccio
$idpar=01;
e poi lo passo al ciclo:
if($id == $idpar) {
printf("[*]<h4>%s
",
trim($link),trim($title),trim($title));
printf("%s
",trim($description));
non funziona..
Qualcuno mi spiega perchè?..Mi sembra stranissimo questo comportmento..