how i can Convert $_POST in a array?

by using

print_r($_POST);

i am getting data something like this

Array ( [selected_friends] => {"0":"699712136","1":"1622040878","2":"100002980112267"})

how i can use it as array and put it into a array variable like

$a[0] = 699712136;
$a[1] = 1622040878;

and so on.

Answers


You could do

$a = json_decode($_POST['selected_friends'], true);

Need Your Help

How do I use a prepared statement in Spatialite Android?

android sql prepared-statement spatialite jsqlite

I'm looking at the tutorial for Spatialite-Android, and I'm noticing the following code samples:

Regex put in via formtastic gets altered (maybe by the controller) before it's put into Mongoid

ruby regex ruby-on-rails-3 mongoid formtastic

I have a form where I put in hashes with regular expression values. My problem is that they gets messed up when travelling from my view, through my controller and into MongoDB with Mongoid. How do I

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.