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? Quote 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? Quote 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); } Quote 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? Quote 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. Quote 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).. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.