3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if(isset($_REQUEST['save'])) { $product_name = implode(",", $_REQUEST["product"]); print $product_name; } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Test</title> </head> <body> <form name="myform" method="post"> <input type="text" name="product[]" value="rose"> <input type="text" name="product[]" value="garlands"> <input type="text" name="product[]" value="marigold"> <input type="text" name="product[]" value="jasmine"> <input type="text" name="product[]" value="jasmine garlands"> <input type="submit" name="save" value="Save"> </form> </body> </html>
based on JqYpk
Output for 4.3.0 - 7.3.0beta1
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Test</title> </head> <body> <form name="myform" method="post"> <input type="text" name="product[]" value="rose"> <input type="text" name="product[]" value="garlands"> <input type="text" name="product[]" value="marigold"> <input type="text" name="product[]" value="jasmine"> <input type="text" name="product[]" value="jasmine garlands"> <input type="submit" name="save" value="Save"> </form> </body> </html>