johnwayne77 Posted December 5, 2008 Share Posted December 5, 2008 how can i clean up my Array ( [.0.] => text1 [1] => text2 ) Array ( [.0.] => text3 [1] => text4 ) result? i just wanna print_r the text2, text4, etc result any ideas? Link to comment https://forums.phpfreaks.com/topic/135618-solved-foreach-array-0-clean-up/ Share on other sites More sharing options...
balistic Posted December 5, 2008 Share Posted December 5, 2008 post your source? Link to comment https://forums.phpfreaks.com/topic/135618-solved-foreach-array-0-clean-up/#findComment-706569 Share on other sites More sharing options...
johnwayne77 Posted December 5, 2008 Author Share Posted December 5, 2008 while (($data = fgetcsv($handle)) !== FALSE) { $show = myfunction($data[0],$data[1]); print_r($show); } Link to comment https://forums.phpfreaks.com/topic/135618-solved-foreach-array-0-clean-up/#findComment-706570 Share on other sites More sharing options...
johnwayne77 Posted December 5, 2008 Author Share Posted December 5, 2008 any ideas? Link to comment https://forums.phpfreaks.com/topic/135618-solved-foreach-array-0-clean-up/#findComment-706575 Share on other sites More sharing options...
genericnumber1 Posted December 5, 2008 Share Posted December 5, 2008 I totally don't understand what you want. Link to comment https://forums.phpfreaks.com/topic/135618-solved-foreach-array-0-clean-up/#findComment-706576 Share on other sites More sharing options...
johnwayne77 Posted December 5, 2008 Author Share Posted December 5, 2008 this is my code <? include("functions.php"); $filename='fields.txt'; $handle = fopen($filename,'r'); while (($data = fgetcsv($handle)) !== FALSE) { $show = function1($data[0],$data[1]); print_r($show); } @fclose($handle); ?> fields.txt contains on each line following info: fielda1, fieldb1 fielda2, fieldb2 ...... the myfunction take fielda1, fieldb1 checks it with a database and returns the result linked to those. the problem is i get the result in the following appeareance: [4] => Array ( [0] => fielda4 [1] => fieldb4 ) i need to have printed only fieldb4 result (without [0][1][4]ARRAY).. Link to comment https://forums.phpfreaks.com/topic/135618-solved-foreach-array-0-clean-up/#findComment-706577 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.