0
<fieldset>
<h2 class="fs-title">Success !</h2>
<h3 class="fs-subtitle">Here is the MAC Address and the Password associated with the User ID provided.</h3>
<div id="wrapper">
<input type="text" id="search" style="text-transform: uppercase;" value="c864c7cf605d" readonly="">
</div>
<div id="wrapper">
<input type="text" id="search" style="height: 55px;" value="123456" readonly="">
</div>
</fieldset>

here , i just want to grab this c864c7cf605d value using curl or file_get_content , how can i do that ?

  • 1
    how can i do that?...By making an effort and showing us you what have tried and how it failed. I suggest reading into `domdocument` and `xpath` which is what you want – gwillie Nov 18 '14 at 06:51

1 Answers1

0

Here is some code to help you to get started:

<?php

$content = '
<fieldset>
<h2 class="fs-title">Success !</h2>
<h3 class="fs-subtitle">Here is the MAC Address and the Password associated with the User ID provided.</h3>
<div id="wrapper">
<input type="text" id="search" style="text-transform: uppercase;" value="c864c7cf605d" readonly="">
</div>
<div id="wrapper">
<input type="text" id="search" style="height: 55px;" value="123456" readonly="">
</div>
</fieldset>';

preg_match('/value="(.+?)"/', $content, $result);
echo $result[1];
?>

The output is: c864c7cf605d

Antoan Milkov
  • 2,152
  • 17
  • 30