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. 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. } } ?> 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. 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
Archived
This topic is now archived and is closed to further replies.