Jump to content

Convert Loop Foreach Results to a Variable String


dsp77

Recommended Posts

Hello, i have the code below and i need to have all results in a variable as a string, inside the loop they are displayed how i want but outside will echo the last result.  Thank You.

foreach($_POST as $key=>$value){
	if (is_numeric($value)) {
			$valoare = "$value,";

		}
}
echo $valoare;

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.