vidyashankara Posted June 9, 2006 Share Posted June 9, 2006 [code]$atomstart= preg_replace('/^(?!ATOM).*?(?:\n|$)/m','',$contents); $atomarray = explode("\n", $atomstart);for ($i=0; $i<count($atomarray); $i++) { preg_match_all("/([^ \r\n]+)(?:[ ]+)*/", $atomarray[$i], $m); $atommatches[$i] = $m[1]; $atom[$i] = $m[1][4];}$atom = array_unique($atom);sort($atom);$atm = count($atom);$atms = implode(", ", $atom);[/code]something is wrong in the for loop. If i echo something before it, it shows up, it i echo something after it, it doesnt. Quote Link to comment https://forums.phpfreaks.com/topic/11605-php-code-error/ Share on other sites More sharing options...
Fyorl Posted June 9, 2006 Share Posted June 9, 2006 are you receiving an error message? What are you trying to echo? A variable or just any crap Quote Link to comment https://forums.phpfreaks.com/topic/11605-php-code-error/#findComment-43829 Share on other sites More sharing options...
vidyashankara Posted June 9, 2006 Author Share Posted June 9, 2006 [!--quoteo(post=382045:date=Jun 9 2006, 04:37 PM:name=Fyorl)--][div class=\'quotetop\']QUOTE(Fyorl @ Jun 9 2006, 04:37 PM) [snapback]382045[/snapback][/div][div class=\'quotemain\'][!--quotec--]are you receiving an error message? What are you trying to echo? A variable or just any crap[/quote]am not receiving any error msg. I echoed just some crap like 123. 123 shows up before the for function, but not after the for function. Quote Link to comment https://forums.phpfreaks.com/topic/11605-php-code-error/#findComment-43830 Share on other sites More sharing options...
Fyorl Posted June 9, 2006 Share Posted June 9, 2006 stick an echo inside the loop spitting like echo $atommatches[$i] . '<br />' and see what it gives you Quote Link to comment https://forums.phpfreaks.com/topic/11605-php-code-error/#findComment-43832 Share on other sites More sharing options...
vidyashankara Posted June 9, 2006 Author Share Posted June 9, 2006 [!--quoteo(post=382048:date=Jun 9 2006, 04:43 PM:name=Fyorl)--][div class=\'quotetop\']QUOTE(Fyorl @ Jun 9 2006, 04:43 PM) [snapback]382048[/snapback][/div][div class=\'quotemain\'][!--quotec--]stick an echo inside the loop spitting like echo $atommatches[$i] . '<br />' and see what it gives you[/quote]I get a blank screen. I have the same script included in the main script right before this script. But i have no problem with tha script. The 2 script are exactly the same, except for the variables except of $i, i figured that should be a problem, because i have twice in the same script and it doesnt give me a error. Quote Link to comment https://forums.phpfreaks.com/topic/11605-php-code-error/#findComment-43835 Share on other sites More sharing options...
Fyorl Posted June 9, 2006 Share Posted June 9, 2006 comment out lines in the loop and starting from the bottom to see which ones cause the screen to blank Quote Link to comment https://forums.phpfreaks.com/topic/11605-php-code-error/#findComment-43838 Share on other sites More sharing options...
vidyashankara Posted June 9, 2006 Author Share Posted June 9, 2006 [!--quoteo(post=382054:date=Jun 9 2006, 04:52 PM:name=Fyorl)--][div class=\'quotetop\']QUOTE(Fyorl @ Jun 9 2006, 04:52 PM) [snapback]382054[/snapback][/div][div class=\'quotemain\'][!--quotec--]comment out lines in the loop and starting from the bottom to see which ones cause the screen to blank[/quote]I commented out $atommatches[$i] = $m[1];But the output isnt right, It processes till the end of the included script. Then it doesnt process the actual script.[!--quoteo(post=382059:date=Jun 9 2006, 04:59 PM:name=Vids)--][div class=\'quotetop\']QUOTE(Vids @ Jun 9 2006, 04:59 PM) [snapback]382059[/snapback][/div][div class=\'quotemain\'][!--quotec--]I commented out $atommatches[$i] = $m[1];But the output isnt right, It processes till the end of the included script. Then it doesnt process the actual script.[/quote]actually the rest of the script works fine now. just the included script doesnt function. there is something wrong with the $atommatches line. Quote Link to comment https://forums.phpfreaks.com/topic/11605-php-code-error/#findComment-43843 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.