I don't understand preg
Anyone got a good tutorial about preg_replace etc?
Printable View
I don't understand preg
Anyone got a good tutorial about preg_replace etc?
I have never found any. I like looking at the comments made on php.net over ways they have used preg_replace, preg_match, etc.
Also, the PHP Bible talks a bit about it. So you may want to look into that book.
thanks, because i really don't understand it :P
LMAO!
Learn through reading other php scripts!
Its how i found out how to use it in the end.
"Learn through doing" best way... shame many dont use that either ;) -- I can post a quick example later on (not got my scripts on me @ college) of how i replace BB Code for a SQL Query :)
(Unless some1 else does it)
But its pretty "funky" and "easy" to copy :P
Not everybody learns the same way...Quote:
Originally posted by wpearsall
shame many dont use that either
I like reading through other people's scripts, but you have to make sure you're reading through good code, otherwise you'll pick up bad habbits.
Good point :)Quote:
Originally posted by Rick Bull
I like reading through other people's scripts, but you have to make sure you're reading through good code, otherwise you'll pick up bad habbits.
Yeah I picked up a load of bad habbits with HTML that way, then when I tried my pages in Netscape they looked really bad. So I had to go and relearn everything properly :(