Jump to content

preg_match


supermerc

Recommended Posts

Here is one solution:

 

example:

$str = '<input type="hidden" name="codeid" value="b726b788e55b9096da3d164580ddf24c">';
preg_match('#<input[^>]*value=[\'"]([a-f0-9]+)[\'"]#i', $str, $match);
echo $match[1];

 

Granted, this makes assumptions that the string value of value only consists of a-f/0-9 one or more times (as this is the only sample you give).

Link to comment
https://forums.phpfreaks.com/topic/169166-preg_match/#findComment-892618
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.