使用PHP获取<a>的值

Okay, so now I am confronted with a new problem, and I just don't know what to do next.

I have a table where the contents of it is dynamically added from a database on page load, and each item in the table is a link. The link looks like this:

$ct->data[$key][3]='<a href="allthread.php?sessid='.SID.'&product='.$ct->data[$key][0].' '.$ct->data[$key][1].' '.$ct->data[$key][3].'&qty='.">'.$ct->data[$key][3].'</a>

Which is great.

But, the user is also allowed to (using ContentEditable) edit the values within the table, and when they then click the link, I need to get the NEW value of the URL with PHP. How can this be done?

Thank you

Your question is not very clear, but I think you must mean extracting the edited href value from the and sending it back to the server (where PHP is running). Is that what you mean?

In that case you need to extract it with Javascript and send it with Ajax.

You need to - identify the element, either by giving them all distinct 'id' properties, or by finding them relative to some other element (using xpath or similar); or if this is triggered by an event, you can find the object the event was triggered on. - extract its 'href' property - send this to a suitable backend program on your server with Ajax.

Does this answer your question?

If I understand you correct, a rtegex is what you need. Look here: http://www.phpf1.com/tutorial/php-regular-expression.html

What you need should look like <a href="([^"]+)">[^<]+</a>