I have a following code:
$string = '{"tracking_url":{"11":{"affiliate":"OMG","url_part1":<<some url>>,"url_part2":<<some url>>"}}}';
$points = json_decode( $string, true );
How do I access url_part1 and url_part2?
Your given string is not valid JSON.
I assume you have something like this
{ "tracking_url":{"11":{"affiliate":"OMG","url_part1":<<some url>>,"url_part2":<<some url>>"}} }
Then you can access the properties after parsing by
$obj = json_decode( '{ "tracking_url":{"11":{"affiliate":"OMG","url_part1":<<some url>>,"url_part2":<<some url>>"}} }', true );
I forgot the output part. As is set the second argument of json_decode() to true, the result is an associative array and you can access/output it like this:
echo $obj['tracking_url']['11']['url_part1'];
echo $obj['tracking_url']['11']['url_part2'];
$obj->{'url_part1'} and $obj->{'url_part2'} are then your variables.echo $points->{'tracking_url'}->{'11'}->{'url_part1'};
var_dump(json_decode($json))will show you what needs to be done.