Jump to content

PHP code Error...


vidyashankara

Recommended Posts



[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.
Link to comment
https://forums.phpfreaks.com/topic/11605-php-code-error/
Share on other sites

[!--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.
Link to comment
https://forums.phpfreaks.com/topic/11605-php-code-error/#findComment-43830
Share on other sites

[!--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.
Link to comment
https://forums.phpfreaks.com/topic/11605-php-code-error/#findComment-43835
Share on other sites

[!--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.
Link to comment
https://forums.phpfreaks.com/topic/11605-php-code-error/#findComment-43843
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.