thewooleymammoth Posted October 28, 2007 Share Posted October 28, 2007 how can you echo an array that only shows the array if it starts with a certain letter? Quote Link to comment Share on other sites More sharing options...
Dragen Posted October 28, 2007 Share Posted October 28, 2007 <?php foreach($array as $v)){ if(ereg('^a', $v){ echo $v; } } ?> If it begins with 'a' it will output the variable, otherwise it will move to the next key. Quote Link to comment Share on other sites More sharing options...
thewooleymammoth Posted October 28, 2007 Author Share Posted October 28, 2007 awesome thanks Quote Link to comment 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.