hi to all

i wana get the Traffic left from rapidshare account
i used this work but it doesnt work anyone cans help me?

ereg("<td>Traffic left:</td><td align=right><b><script>document\.write\(setzeTT\(\"\"\+Math\.ceil\((\d+)/1000\)\)\);</script> MB</b></td>", $pagedata, $traffic);

html code of this part is :

<td>Traffic left:</td><td align=right><b><script>document.write(setzeTT(""+Math.ceil(-123313/1000)));</script> MB</b></td>

i need this number : -123313 in html

Recommended Answers

All 2 Replies

Can you post your whole script please.

You would need to use curl to login to Rapidshare then take the data.

hi to all

i wana get the Traffic left from rapidshare account
i used this work but it doesnt work anyone cans help me?

ereg("<td>Traffic left:</td><td align=right><b><script>document\.write\(setzeTT\(\"\"\+Math\.ceil\((\d+)/1000\)\)\);</script> MB</b></td>", $pagedata, $traffic);

html code of this part is :

<td>Traffic left:</td><td align=right><b><script>document.write(setzeTT(""+Math.ceil(-123313/1000)));</script> MB</b></td>

i need this number : -123313 in html

In the regular expression, add -? before the number match. (\d+)

The ? means to match 0 or 1 occurrence. So it will match the negative character or skip it if the number is positive.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.