The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Hello
I'm coding a mod for vb I'm having problem with parse_str() function in following code block : Quote:
/sent?r345dfd32s&link=general&ac=3245534893783&status=waiting I wanna store only numbers under "ac" in some string variable. However, above code snippet results no data (blank) in $temp. Is it because parse_str() is used within foreach() loop? (I have to use it in foreach() because $urls contains different links everytime. Or is there any other way?) If i remove foreach() loop then code works perfect. Can any1 please help me with this?? You will get full credit in mod for solving this issue. |
#2
|
||||
|
||||
![]()
You should use the vb cleaner:
PHP Code:
PHP Code:
|
#3
|
||||
|
||||
![]()
Actually i'm trying to do non vb thing in mod.
So there there is no global.php included. And i dont think its reasonable to call global.php in script just for this reason. Also the link i'm trying to parse is not fetched from actual url (the one in browser) It is just a variable name i used. So the actual string that has to be parsed is contained in $urls string variable. How do i get that "ac" numbers? |
#4
|
||||
|
||||
![]()
$_GET['ac'] should be the variable name, I believe.
|
#5
|
||||
|
||||
![]()
I think you didnt get what i'm trying to do here..
See, this data is not coming from any form etc. The data is calculated/captured on runtime using preg_match() functions... Its CURL related things i'm doing in mod. Following code is contained in $urls (Array). Code:
/sent?r345dfd32s&link=general&ac=3245534893783&status=waiting However, i'm already having $urls (As a string for each index) the only thing is i wanna have "ac" numbers in some variable (For comparison purpose.. i'm not gunna echo 'em). And yeah, i also tried with urldecode() etc. The problem is, following code works perfect if i remove foreach() loop (i.e. it will b processing only 1 $urls) Code:
parse_str($urls); $temp=$ac; So i guess (it may be stupid but still) parse_str() having hard time because of foreach(). The thing is, i googled a lot (and really a lot)... but i didnt find parse_str() written under foreach() loops anywhere.. but i also didnt find never to use parse_str() under foreach() written anywhere.. So i'm really really confused and stumped!! ![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|