Answer the question
In order to leave comments, you need to log in
How to write each value separately?
Through curl I get HTML:
<title>TEST PAGE</title>
<body background="fon.jpg">
<h1 style="text-align:center;">TEXT</h1>
<p style="text-align:center;">GOOD</p>
</body>
<center>
<form method="POST" action="" style="margin-top:5%">
</form>
<br/><br/>
Name: Moscow<br>Status: <font color=red>Yes</font><br>Number Status: <font color=green>5009</font><br>Phone number: <font color=red>+790000000</font><br></center>
</center>
</body>
if ($data != Error)) {
//
}
$json = '{"a":1,"b":2,"c":3,"d":4,"e":5}';
it will easily refer to "a" and get the number 1. I need about the same thing. Can somehow write this data through json_encode or write it to an array? Answer the question
In order to leave comments, you need to log in
Dumb option:
if (preg_match("#</form>[\s\r\n]*<br/><br/>[\s\r\n]*(.+?)</center>#s", $data, $regs))
{
foreach(explode("<br>", $regs[1]) as $v)
{
if (preg_match("#^([^:]+):\s*(.+)$#", strip_tags($v), $regs2))
{
$arr[$regs2[1]] = $regs2[2];
}
}
}
echo($arr['Name']." = ".$arr['Status']); // Moscow = Yes
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question