newbtophp Posted October 6, 2009 Share Posted October 6, 2009 How would i get the numbers which are after the comma within the brackets: Like for example code (the code and the variables are always different but the rule is the same): $O0ghhss=fopen($Oedfdsfg00,'rb');while(--$scande354)fgets($v0o00arys,1024);fgets($O000O0O00,2036);$OO00O00O0=(base64_decode(strtr(fread($O0gfdfgdf0O00,362),'ywkhRHYKNWOUTAaBbCcDdFfGgIiJjLlMmPpQqSsVvXxZz0123456789+/=','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')));echo($aO0fdsf00O0); The number is: 362 So the rule is the number is always before the first string within the single quotes: 362),'1STSTRING' $* = Random variable, with letters (lower and upercase) and numbers. 1STSTRING = Random string containing letters (lowercase and uppercase), numbers, slashes, + signs and = symbols. Quote Link to comment https://forums.phpfreaks.com/topic/176733-solved-get-the-number-which-is-before-the/ Share on other sites More sharing options...
cags Posted October 6, 2009 Share Posted October 6, 2009 Looking at the example it also contains plus and forward slash, is this a requirement? Quote Link to comment https://forums.phpfreaks.com/topic/176733-solved-get-the-number-which-is-before-the/#findComment-931778 Share on other sites More sharing options...
newbtophp Posted October 6, 2009 Author Share Posted October 6, 2009 Looking at the example it also contains plus and forward slash, is this a requirement? Yes some strings contain forward slashes, some dont, some strings contain + some dont. So its literally random string but always within the same rule/requirement. Quote Link to comment https://forums.phpfreaks.com/topic/176733-solved-get-the-number-which-is-before-the/#findComment-931780 Share on other sites More sharing options...
cags Posted October 6, 2009 Share Posted October 6, 2009 How about something like this... preg_match("/,(\d*?)\),'.*?'/", $input, $out); echo $out[1]; Quote Link to comment https://forums.phpfreaks.com/topic/176733-solved-get-the-number-which-is-before-the/#findComment-931794 Share on other sites More sharing options...
newbtophp Posted October 6, 2009 Author Share Posted October 6, 2009 Thanks Cags! That worked perfect! Solved Quote Link to comment https://forums.phpfreaks.com/topic/176733-solved-get-the-number-which-is-before-the/#findComment-931796 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.