Reply to Re: preg_replace

Your name:

Reply:


Posted by Lars Eighner on 11/02/07 20:44

In our last episode, <fgfoi9$b18$1@mawar.singnet.com.sg>, the lovely and
talented Silvertype broadcast on comp.lang.php:

> Yup, I have looked into google already. There are indeed a lot of info on
> regex but unfortunately, due to my closing project deadline, I do not have
> time to go through all of them. Therefore, I would greatly appreciate if you
> (or anyone reading this) can provide me with a slightly more comprehensive
> solution. Thanks again.


Once again, you have not made clear what the nature of your problem is.

Perl itself, not php preg_replace, is the most effective way to search and
replace in a large number of files.

Even so, you would have to define the precise conditions under which you
want the replacement made. If you could do that, of course, your problem
would be easily solved if you consulted the manual on preg_replace.

Someone could, of course, give you function calls that would make the
replacement in the two strings you have given. But if you really needed to
change only these two strings, you would simply make the changes with a text
editor. Therefore, we all suppose your problem is more general (unless of
course it is homework). Do you want to add your "onclick" event to every
input element and every textarea element? Or are there particular
conditions on the ones you want to replace?

That returns us to the question of context. Where are the strings coming
from? Are you generating them? Are they static parts of pages that also
contain php? Are you serving the pages directly, or are you using php cli
to modify existing files?

In other words, it appears you cannot --- at least you have not --- defined
the problem.

Don't top post.

--
Lars Eighner <http://larseighner.com/> <http://myspace.com/larseighner>
Countdown: 444 days to go.
What do you do when you're debranded?

[Back to original 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

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