私はこのコードを持っています!私は最後のregex find - >見つけて置き換える
'<div class="time\69">'
を取る必要がある
<div class="time\54>
<div class="time\98">
<div class="time\69">
<div id="result">{INFO}</div>
は次に '時間' の後に、この最後のdivの中の数字を取り、(6 + 9)、それを合計し、{INFO}フィールドにつながる置きます。
だけにpreg_replace
結果使用必要があります。最後の子(要素のdivを)取る方法
<div class="time\54>
<div class="time\98">
<div class="time\69">
<div id="result">15</div>
を?
数字の合計はどのようにするのですか?
覚えておく方法($ 1または%1を使用しますか?)
Thx。
あなたはそのhtmlを持っていますか?あなたはPHP経由でそれを生成しますか? 'foreach'を介して? – Shikiryu
http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags – Marnix