Finding text three characters before chosen string

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
grgwhl
Forum Newbie
Posts: 3
Joined: Mon Dec 29, 2008 12:00 pm

Finding text three characters before chosen string

Post by grgwhl »

Hi, Seasons greetings etc. everybody, I hope you had a good one! I need some help please ! I have a html file in a var called $html which I have got using CURL.

In this file there is a tag called <beforethis>. And just before this tag is a number (it could be 1 digit or 2).

How would I go about searching through $html and finding the number just before the <beforethis> tag?

I'd be REALLY greatful if anybody could help, I've tried to explain clearly but if I haven't I'll be willing to elaborate.

Many Thanks
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Finding text three characters before chosen string

Post by requinix »

Which PHP are you running? Is it really HTML, or is it XML?
Post Reply