Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

I'm getting input from text field dynamically by angularjs

Array format

 item[0]['id'] = 0;
 item[1]['text'] = 'abc';
 item[0]['id'] = 1;
 item[1]['text'] = 'xyz';
 .
 .
 .
 item[0]['id'] = n;
 item[1]['text'] = 'zxc';

I want to post this array to my php script using angularjs service API

php script should accept this 2d array and save to database.

share|improve this question
    
What have you tried already? What part isn't working already? We're here to help you understand what needs to be done to solve your problem, not just provide code. The more detailed information you can provide, generally the better your questions is. (The exception being: don't just dump every line you've written into the question.) – Andrew G Jun 17 at 6:04

For posting the data to your php script you can use Angular's $http provider:

$http.post('/script.php', item).then(successCallback, errorCallback);

Your PHP script will receive these values in the global $_POST variable, from there you can process the data and save it to your database.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.