4
4
4sadly2020-04-27 17:03:22
PHP
4sadly, 2020-04-27 17:03:22

How to get this line?

I need to get values ​​from a tag that cannot be changed, here is the code that is in the form: How can I get this id?
<a name="id"><?= $order['id']; ?></a>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2020-04-27
@4sadly

$re = '/<a name="id">(\d+)/';
if (preg_match($re, $html, $m)) {
echo $m[1];
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question