I was going through this book on php and i was left confused what author is trying to convey.

Following is that part.

You must use quotes if you’re using interpolation to build the array index:
However, don’t quote the key if you’re interpolating an array lookup:
// these are wrong
print "Hello, $person['name']";
print "Hello, $person["name"]";
// this is right
print "Hello, $person[name]";

My question is:
1) What is interpolation to build array index?


"interpolation to build the array index"
By this sentense I think author may be trying to say that he is forming a index value using variable $number.


He is joing string "Clone" and value from variable $number to form new more index value like
That is interpolation.
Here we do not know the value of $number which can be dynamin (anything)

And If we dont use quotes in that , it will throw error.

Please refer Variable_interpolation