PHP & Array question

kennith

New Member
I have an array called $array_all;This array will always have 3 possible values:
  • 1,
  • 1,2,
  • 1,2,3,
I created a string from the array while in a foreach loop and concatenated a comma at the end.So, now I have a nice string that outputs the exact value the way it should.1,2,3, I can copy this output from my browser and insert it into my wordpress function and everything displays perfectly.The problem arises when I insert this string variable in the wordpress function directly, it fails.Anybody have any ideas?Code below: \[code\]<?php $faux_array = array();$faux_array_all;if($five_loans != ''): $faux_array[] = "781";endif; if($logbook_loans != ''): $faux_array[] = "797";endif;if($easy_money != ''): $faux_array[] = "803";endif;foreach($faux_array as $faux_array_value): $faux_array_all .= $faux_array_value . ',';endforeach;echo $faux_array_all;$args = array( 'posts_per_page' => 10, 'post_type' => 'lender', 'order' => 'ASC', 'orderby' => 'date', 'post__in' => array($faux_array_all));?>\[/code\]
 
Back
Top