Kano Posted March 15, 2007 Share Posted March 15, 2007 Hi there, Is there another way of writing this function because I do not want it to go through all the $fields, I just want to loop through fields with an index of: qty_ thanks. Quote Link to comment https://forums.phpfreaks.com/topic/42855-solved-for-each-_post-as-field-value/ Share on other sites More sharing options...
trq Posted March 15, 2007 Share Posted March 15, 2007 <?php foreach($_POST as $k => $v) { if (substr($k,0,4) == 'qty_') { // do whatever. } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/42855-solved-for-each-_post-as-field-value/#findComment-208076 Share on other sites More sharing options...
Kano Posted March 15, 2007 Author Share Posted March 15, 2007 Many thanks thorpe. Quote Link to comment https://forums.phpfreaks.com/topic/42855-solved-for-each-_post-as-field-value/#findComment-208078 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.