Insert Dynamic Array

I’m working on docusign app, and if I have 1 Signer it’ll fill in the signing array if i have 2 signers it’ll add extra signer array. However i can’t add If $secondsigner put array here inside the array. I also tried

if secondsigner ‘array(infostuff)’; didn’t work well

how i can i add the array inside the array?

"recipients" => array( "signers" => array(

						array( "email" => $sh1_email,
						"name" => $sh1_name,
						"recipientId" => "1",
						"tabs" => array(

						"initialHereTabs" => array(
						array(
						"xPosition" => "480",
						"yPosition" => "130",
						"documentId" => "1",
						"pageNumber" => "1"
						),
						array(
						"xPosition" => "480",
						"yPosition" => "760",
						"documentId" => "1",
						"pageNumber" => "1"
						),
						array(
						"xPosition" => "480",
						"yPosition" => "760",
						"documentId" => "1",
						"pageNumber" => "2"
						),
						array(
						"xPosition" => "480",
						"yPosition" => "760",
						"documentId" => "1",
						"pageNumber" => "3"
						)
						
					),
					"signHereTabs" => array(
						array(
						"xPosition" => "100",
						"yPosition" => "350",
						"documentId" => "1",
						"pageNumber" => "3"
						),
						array(
						"xPosition" => "100",
						"yPosition" => "520",
						"documentId" => "1",
						"pageNumber" => "3"
						),
						array(
						"xPosition" => "80",
						"yPosition" => "620",
						"documentId" => "1",
						"pageNumber" => "4"
						)
						)
					
				)
			)
						

/* Start Additional Signer Here */						

,                                       array("email" => $sh2_email,
						"name" => $sh2_name,
						"recipientId" => "2",
						"tabs" => array(

						"initialHereTabs" => array(
						array(
						"xPosition" => "530",
						"yPosition" => "130",
						"documentId" => "1",
						"pageNumber" => "1"
						),
						array(
						"xPosition" => "530",
						"yPosition" => "760",
						"documentId" => "1",
						"pageNumber" => "1"
						),
						array(
						"xPosition" => "530",
						"yPosition" => "760",
						"documentId" => "1",
						"pageNumber" => "2"
						),
						array(
						"xPosition" => "530",
						"yPosition" => "760",
						"documentId" => "1",
						"pageNumber" => "3"
						)
						
					),
					"signHereTabs" => array(
						array(
						"xPosition" => "100",
						"yPosition" => "395",
						"documentId" => "1",
						"pageNumber" => "3"
						),
						array(
						"xPosition" => "100",
						"yPosition" => "565",
						"documentId" => "1",
						"pageNumber" => "3"
						)
						)
				
)				)

/* end Second Additional Signer Here */						

			)


),

I feel like i’ve come into the middle of a conversation…

How is this data being fed in?

The normal syntax is just $array[‘recipients’][‘signers’] = $newarray; …

The Array is fed in exactly as you how see it. I’ll post the PHP Code …

Second Signer is optional and is based if there’s a second signer in the database.

so i was trying to do

if($signer2) { // then put signer array here }

but the array value are preset, as they’re (x/y) coordinates for the Initial and Signing Tabs for DocuSign.


$data = array (
"emailBlurb" => "Please review agreement.",
"emailSubject" => "DocuSign Agreement",
"documents" => array(array( "documentId" => "1", "name" => "NameofPDF.pdf")),
"recipients" => array( "signers" => array(

						array( "email" => 'signer@email.com',
						"name" => 'My Name',
						"recipientId" => "1",
						"tabs" => array(

						"initialHereTabs" => array(
						array(
						"xPosition" => "480",
						"yPosition" => "130",
						"documentId" => "1",
						"pageNumber" => "1"
						),
						array(
						"xPosition" => "480",
						"yPosition" => "760",
						"documentId" => "1",
						"pageNumber" => "1"
						),
						array(
						"xPosition" => "480",
						"yPosition" => "760",
						"documentId" => "1",
						"pageNumber" => "2"
						),
						array(
						"xPosition" => "480",
						"yPosition" => "760",
						"documentId" => "1",
						"pageNumber" => "3"
						)
						
					),
					"signHereTabs" => array(
						array(
						"xPosition" => "100",
						"yPosition" => "350",
						"documentId" => "1",
						"pageNumber" => "3"
						),
						array(
						"xPosition" => "100",
						"yPosition" => "520",
						"documentId" => "1",
						"pageNumber" => "3"
						),
						array(
						"xPosition" => "80",
						"yPosition" => "620",
						"documentId" => "1",
						"pageNumber" => "4"
						)
						)
					
				)
			)
						

/* Start Additional Signer Here */						

,
					array("email" => 'signer2@email.com',
						"name" => 'signer 2 name',
						"recipientId" => "2",
						"tabs" => array(

						"initialHereTabs" => array(
						array(
						"xPosition" => "530",
						"yPosition" => "130",
						"documentId" => "1",
						"pageNumber" => "1"
						),
						array(
						"xPosition" => "530",
						"yPosition" => "760",
						"documentId" => "1",
						"pageNumber" => "1"
						),
						array(
						"xPosition" => "530",
						"yPosition" => "760",
						"documentId" => "1",
						"pageNumber" => "2"
						),
						array(
						"xPosition" => "530",
						"yPosition" => "760",
						"documentId" => "1",
						"pageNumber" => "3"
						)
						
					),
					"signHereTabs" => array(
						array(
						"xPosition" => "100",
						"yPosition" => "395",
						"documentId" => "1",
						"pageNumber" => "3"
						),
						array(
						"xPosition" => "100",
						"yPosition" => "565",
						"documentId" => "1",
						"pageNumber" => "3"
						)
						)
				
)				)

/* end Second Additional Signer Here */						

			)


),
"status" => "sent");

print_r($data);


Thanks for the help… i figured it out… I was over complicating the issue.