Need a halp!PHP homework!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pupupusik
Forum Newbie
Posts: 2
Joined: Wed Feb 03, 2010 11:03 am

Need a halp!PHP homework!

Post by pupupusik »

Plese I need that for morning for tomorrow!
Thanks!

2. You have been asked to do some textual analysis of html code programatically. Given HTML code as input please provide answers to the following:

a) Write a php function which will take as input a parameter containing random html code. Examine the code and extraxt the text from the deepest nested tag fount in the code. Example:

INPUT:
$x= '
Hello there. <p> Today it was a <b>beautiful</b> sunny day in <a href="http://israel.co.il">Tel Aviv</a> sea shore. Having come from a <span class="newtext">country which does not have a sea <span class="more"> <br />I found it very interesting to look at the <strong>waves</strong></span> smashing <b>against</b> the </span>walls of the harbour</p>
'
foo($x);

OUTPUT
waves

b) Please write a php function which will take a html code as parameter and output the nesting level of each tag in their order of appearance preceeded by the tag name. For example for input from a) the result would be:
p -> 1
b -> 2
a -> 2
span -> 2
span -> 3
br -> 3
strong -> 4
b -> 2
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Need a halp!PHP homework!

Post by AbraCadaver »

Do your own homework! How do you expect to learn? Haven't you been studying / paying attention in class?
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
pupupusik
Forum Newbie
Posts: 2
Joined: Wed Feb 03, 2010 11:03 am

Re: Need a halp!PHP homework!

Post by pupupusik »

So what!!!!!!!!!!!!!!!!!!!1
I need a halp pleeeeeeeessssssssss!
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Need a halp!PHP homework!

Post by califdon »

We don't help people who just want someone to do their work for them. If you don't understand some concept, we will try to explain it to you so you can learn, but we don't help people cheat.
Post Reply