As you might know, I suck at regex.. but I have to use it. And I'm hoping you could help me.
So this is my problem.
Before sending the html code to the client, I would like to pass it into a function that will modify it a little bit.
For every <form> tag I would like to add a input type hidden in it.
I need to use preg_replace_callback since the value of the hidden will change for every form.
The value is calculed with the action of the form, so it has to be sended as parameter to the function.
A second parameter might be sended depending if he exist inside the <form> tag.
The second parameter has to be removed (if he existed)
So this is what I have so far (not much, but can help)
preg_replace_callback('/(<form.*.>)/', 'FN_Hidden::createHidden', $this->childData)
Right now, I find every <form action=...> but not if the tag dosen't have space in it like so <form>
And I don't send any parameters to the function.
I know, this might be a lot to ask, so I don't ask you to solve everything
But if you could just guide me in the right direction, I should be able to do the rest
Thank you


Sign In
Create Account


Back to top









