<?php
$get = '<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<input value="2530317381" name="X-Tmx-session-id" id="X-Tmx-session-id" type="hidden">
<input value="2530317382" name="X-Tmx-session-id" id="X-Tmx-session-id" type="hidden">
<input value="2530317383" name="X-Tmx-session-id" id="X-Tmx-session-id" type="hidden">
<input value="2530317384" name="X-Tmx-session-id" id="X-Tmx-session-id" type="hidden">
</body>
</html>';
$doc = new DOMDocument();
@$doc->loadHTML($get);
$xpath = new DOMXpath($doc);
$doc = NULL;
$allInputs = $xpath->query('*/input[@id=\'X-Tmx-session-id\']');
foreach ($allInputs as $input) {
echo 'valor do input: ', $input->getAttribute('value'), PHP_EOL;
}
PD9waHAKJGdldCA9ICc8IURPQ1RZUEUgaHRtbD4KPGh0bWw+CjxoZWFkPgogICAgPHRpdGxlPjwvdGl0bGU+CjwvaGVhZD4KPGJvZHk+CiAgICA8aW5wdXQgdmFsdWU9IjI1MzAzMTczODEiIG5hbWU9IlgtVG14LXNlc3Npb24taWQiIGlkPSJYLVRteC1zZXNzaW9uLWlkIiB0eXBlPSJoaWRkZW4iPgogICAgPGlucHV0IHZhbHVlPSIyNTMwMzE3MzgyIiBuYW1lPSJYLVRteC1zZXNzaW9uLWlkIiBpZD0iWC1UbXgtc2Vzc2lvbi1pZCIgdHlwZT0iaGlkZGVuIj4KICAgIDxpbnB1dCB2YWx1ZT0iMjUzMDMxNzM4MyIgbmFtZT0iWC1UbXgtc2Vzc2lvbi1pZCIgaWQ9IlgtVG14LXNlc3Npb24taWQiIHR5cGU9ImhpZGRlbiI+CiAgICA8aW5wdXQgdmFsdWU9IjI1MzAzMTczODQiIG5hbWU9IlgtVG14LXNlc3Npb24taWQiIGlkPSJYLVRteC1zZXNzaW9uLWlkIiB0eXBlPSJoaWRkZW4iPgo8L2JvZHk+CjwvaHRtbD4nOwoKJGRvYyA9IG5ldyBET01Eb2N1bWVudCgpOwpAJGRvYy0+bG9hZEhUTUwoJGdldCk7CgokeHBhdGggPSBuZXcgRE9NWHBhdGgoJGRvYyk7CiRkb2MgPSBOVUxMOwoKJGFsbElucHV0cyA9ICR4cGF0aC0+cXVlcnkoJyovaW5wdXRbQGlkPVwnWC1UbXgtc2Vzc2lvbi1pZFwnXScpOwoKZm9yZWFjaCAoJGFsbElucHV0cyBhcyAkaW5wdXQpIHsKICAgIGVjaG8gJ3ZhbG9yIGRvIGlucHV0OiAnLCAkaW5wdXQtPmdldEF0dHJpYnV0ZSgndmFsdWUnKSwgUEhQX0VPTDsKfQ==