Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Helps to Parse multidimensional arrays sent via $_POST correctly

Notifications You must be signed in to change notification settings

livigbaji/-_POSTARRAY

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

-_POSTARRAY

Helps to Parse multidimensional arrays sent via $_POST correctly.

When parsing the $_POST array, PHP tends to have problems parsing multidimensional arrays whose names have spaces e.g name[bestbrain 10] so, this project parses the php raw input stream directly and arranges any matches into multidimensional arrays

Example

form.html

<form method="post">
  <input name="dimension[head]" />
  <input name="dimension[shoulder]" />
  <input name="dimension[waist to heels]" />
  <input name="dimension[burst to breast]" />
  <button>Submit</button>
</form>

submit.php

<?php
  require_once('index.php');
  echo "<pre>";
  print_r($_POST);//before
  $_POST = parsePost(file_get_contents('php://input'));
  print_r($_POST);//after parsing

About

Helps to Parse multidimensional arrays sent via $_POST correctly

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages