Let's say I have a series of $_POST
values, all of them structured like $_POST['shop_1']
, $_POST['shop_2']
, $_POST['shop_2']
(....).
I would need to join all the values of them into a comma-separated string, so at first I have to identify them. What would be the best way to do it?
The code might look something like:
foreach ( ??array_identify??("shop_*",$_POST) as $shop )
{
$string .= $shop.",";
}