You are here: Re: How to do search and replace in an html file? « PHP Programming Language « IT news, forums, messages
Re: How to do search and replace in an html file?

Posted by Dave on 10/06/40 11:17

Kevin Morgan (kevin@nospammistever.co.uk) decided we needed to hear...
> I've written a script that extracts part of a remote web page for me to
> put into a mac dashboard widget. What I need to do is replace each:
>
> <a class='pollBoxA' href='http://www.foobar.com'> text goes here </a>
>
> with
>
> <span onclick=”widget.openURL(â€=3Fhttp://www.foobar.com/â€=3F);”> text goes
> here</span>.
>
Your best bet is probably using a regex. Check out some of the PHP
functions here http://www.php.net/manual/en/ref.pcre.php
You'll find some good examples and tutorial links here
http://www.regexplib.com/Default.aspx

<snip example output>
>
>
> How on earth can I do this?
>
> Thanks,
>
> Kev
>
>

--
Dave <dave@REMOVEbundook.com>
(Remove REMOVE for email address)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация