|
Posted by Toby Inkster on 10/21/07 11:19
Joseph Misko wrote:
> str_replace seems to have worked a charm! Before your post, working with
> the text like this had crossed my mind, but I thought it would be too
> laborious. It's simple.
No problem. PHP has some really nice string manipulation functions.
Arguably more powerful than Perl[1] although the syntax is not quite
as easy to use.
____
1. Justification: in PHP, for most string operations (matching, replacing,
splitting, etc) you can choose between Perl-compatible regular expressions,
extended regular expressions, simple strings and so forth. With Perl you
pretty much always have to use regular expressions.
,=======================================================================.
| | matching | replacing | splitting |
|-----------------------------------------------------------------------|
|Simple strings | strstr() | str_replace() | explode() |
|Ditto Case-Ins | stristr() | str_ireplace() | NO SUCH FUNCTION|
|Extended Reg Exp | ereg() | ereg_replace() | split() |
|Ditto Case-Ins | eregi() | eregi_replace() | spliti() |
|Perl-compat Reg Exp | preg_match() | preg_replace() | preg_split() |
`======================================================================='
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Navigation:
[Reply to this message]
|