php - regex find input value -


the string is:

<input type="hidden" name="billing[address_id]" value="34543" id="billing:address_id" /> 

how can input value string? tried code:

preg_match('/<input type="hidden" name="billing[address_id]" value="(.*?)" id="billing:address_id" \/>/mis', $html, $results); 

your regex correct.. escape [ , ] @ address_id.

preg_match('/<input type="hidden" name="billing\[address_id\]" value="(.*?)" id="billing:address_id" \/>/mis', $html, $results); 

Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - Rendering a QGraphicsScene to QImage results in objects being placed on a side of QImage -