Why do you think this wont work

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
azz0r_
Forum Commoner
Posts: 27
Joined: Mon Jan 24, 2005 4:15 pm

Why do you think this wont work

Post by azz0r_ »

nm
Last edited by azz0r_ on Wed Feb 09, 2005 11:26 am, edited 1 time in total.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

The reason it isn't working is becuase your preg_replace is only replacing the first [img]and%20last[/img] tag
azz0r_
Forum Commoner
Posts: 27
Joined: Mon Jan 24, 2005 4:15 pm

Post by azz0r_ »

Strange, how can I get it to replace the right ones?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it's not strange.. you use the ungreedy modifier, but use the negation in your third grouping.
azz0r_
Forum Commoner
Posts: 27
Joined: Mon Jan 24, 2005 4:15 pm

Post by azz0r_ »

nm fixed.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

basically, remove the + in here (.+?)

Your code still doesn't work, cos the image height and width dont work.

Dunno if you are still working on that bit tho
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

uhh.. Please don't remove your original posts or answers to that, it kinda defeats the purpose of being able to search for answers.
Post Reply