i want to get the content in label; for example, my aim is echo tttt and haha
<?php
$s="<title>tttt</title><body \"df\">haha</body>";
ereg("<.+>[>]<\/.>",$s,$x);
echo "$s\n";
echo count($x);
for ($i=0;$i<count($x);$i++);
echo "$x[$i]\n";
?>
Your missing a ">" after your <body> tag. You've got it like this: <body . Just throw that in there.
i'm sorry,it is a mistake when i post it.i've corrected it. it still doesn't work!
Try your for statement like this:
for ($i=0;$i<count($x);$i++) { echo "$x[$i]\n"; }
thank u very much! the problem caused by the semicolon at the end of "for()". but i how can i get the tttt and haha seperately? i mean it should be: tttt haha not <title>asdfsaf</title><body \"df\">haha</body>