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 - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -