0

In the following code , in the echo of preview why i am getting only h.

  echo "<pre>";
  print_r($thumb);
  echo $thumb=$thumb['thumb']."<br/>";
  echo $preview=$thumb['preview'];
  exit;

Array
(
    [thumb] => http://dtzhqpwfdzscm.cloudfront.net/4d52463406ce5.jpg
    [preview] => http://dtzhqpwfdzscm.cloudfront.net/4d5246345dac0.jpg
)
http://dtzhqpwfdzscm.cloudfront.net/4d52463406ce5.jpg
h

Please suggest thanks

0

3 Answers 3

2

Because you've overwritten $thumb variable. Change to:

  echo "<pre>";
  print_r($thumb);
  echo $thumb['thumb']."<br/>";
  echo $thumb['preview'];
  exit;
Sign up to request clarification or add additional context in comments.

Comments

2

Because you are turning the array into a string here:

$thumb=$thumb['thumb'] 

3 Comments

@zerkms but yours is more detailed... It'll win in the end :)
[irony mode on]AT SO IT IS MORE IMPORTANT TO GET MORE REP POINTS, AND NOT TO WRITE A BETTER ANSWER[/irony mode on] ;-)
0

It´s because of this line:

echo $thumb=$thumb['thumb']."<br/>";

Remove the $thumb=

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.