Php - How do I use a for loop inside API request -


here sample request works, names hard coded

$client->batchdeleteattributes(array(     'domainname' => $domainname,     'items' => array(          array('name' => '5149572a86deb5161fbb22bdab',),          array('name' => '5149572a86deb5161fbf7487b9',),      ) )); 

i can name values using following loop

foreach($_post['d'] $key => $value) {  } 

i confused how integrate foreach loop api request. assume need create array using foreach loop , use array in api request don't know syntax.

thanks!

without knowing format of $_post data it's hard give detailed solution, along these lines should heading in right direction:

$names = array(); foreach ($_post['d'] $value) {     $names[] = array('name' => $value); } 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -