How can i tie these 2 together? The only way i can think of is to call the array in the $replacement string, but dont know how to do so with an array
October 13th, 2008, 09:25 PM
I would love to answer your question but it is so unclear what you are asking for..
October 13th, 2008, 11:05 PM
I have a database that has html content that i display on 2 different pages. In that database the content has several img tags. What i want to do is add width and height to the tag with a new size (i want to make it smaller). I have a function that will return the new size of the image in an array, and can add a fixed width and height to the img tag, but i cant get it to get the values from the function and put that in the width and height. So for example here is my code
I'm not sure where the $2 comes from, i'm guessing it has something to do with preg_replace. I knew the first one wouldnt work, but the 2nd code should, at least i would think, but i'm no expert.
Hope this is a bit clearer
October 14th, 2008, 12:04 AM
Well there are a few things...
Assuming that imagereduction is a valid and working function already:
the $2 variable is not declared any where?
and $2 is not a valid variable in php - a variable must start with a letter..
October 14th, 2008, 12:25 AM
I'm not sure where $2 comes from but this works, i've tested it