PHP removing string in URL's source

Hello,

i am currently making a script  which is stripping some data off an internet site. Now one of the lines are troubling me and those are the ones with current date in it.

I am sure i could strip those too with some universal command but i am not sure which one.

So string look like this:  <report date="2012-08-31" valid="2012-09-01">

I need to remove whole string and not just dates in it.

Thank you!
Caruso_euAsked:
Who is Participating?
 
acbxyzConnect With a Mentor Commented:
Can you be a bit more specific.

If the line is static, with a fixed dated, you can use str_replace to remove parts of a string. If it is dynamic, you can use preg_replace
$newstring = preg_replace('/<report date="\d\d\d\d-\d\d-\d\d" valid="\d\d\d\d-\d\d-\d\d">/', '', $oldstring);

Open in new window

0
 
Caruso_euAuthor Commented:
Exactly what i needed!

Thank you!
0
 
Ray PaseurCommented:
Please post the URL of the internet site so we can see the source that you want to strip.  Then we can give you a tested code sample.

You can probably use this function:
http://us.php.net/manual/en/function.strip-tags.php#93567
0
 
Caruso_euAuthor Commented:
Ray_Paseur : Thank you but solution to my problem was posted already!

Thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.