0

I use API SendPulse:

$bookName = 'mybook1';
$NewBook = $SPApiClient->createAddressBook($bookName);

$results = var_dump($NewBook);

and get an answer

object(stdClass)#4 (1) { ["id"]=> int(1711458) }

how do I get an id for later use in code in a variable such as $myid?

graf-8269
  • 41
  • 5

1 Answers1

0

Its an object property

$var = $NewBook->id;

But why put it in another variable, its an object with a property, so use the objects property where ever you need the data just use $NewBook->id

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149