I am fairly new to handling strings and arrays I was wondering if someone could help.
I am using the following; file_get_contents()
$xml = file_get_contents("https://explorer.casinocoin.org/ext/getaddress/c4fpX7druW1JfgveFq6e7WabveVkAvW7gj");
which returns the following output;
{"address":"WALLET ADDRESS","sent":0,"received":1110,"balance":"BALANCE AMOUNT","last_txs":[{"type":"vout","addresses":"EXAMPLE 1"},{"addresses":"EXAMPLE 2","type":"vout"},{"addresses":"EXAMPLE 3","type":"vout"},{"addresses":"EXAMPLE 4","type":"vout"}]}
I have tried looking to foreach
and also explode()
however I can't get these to work.
I need to be able to define the addresses in the output so I can reference them later.
I am not sure how I would implement a foreach into this example and define the address; I need it to perform like the following;
foreach addresses {
$addresses = 'Example 1';
}
and the next cyle would be;
foreach addresses {
$addresses = 'Example 2';
}
I do apologize for asking for help I'm just having great difficulty defining these values ; I also wasn't sure if I needed to convert this string into an array instead.