0
require_once 'include/load_it.php';
$nice = ($_GET['nice']);
$Key = 'tfvs7'; // Your API key
$remix = new Load_Service_Con($Key);
$result = $new->product($nice)->show(array('salePrice','url'))->query();
echo $result;

I am trying to figure out how I can extract the values of the array and echo the values into seperate div's

Thanks

Vamsi Krishna B
11.5k15 gold badges71 silver badges96 bronze badges
asked Mar 22, 2011 at 0:17
3
  • i think that you should add some code formatting :) Commented Mar 22, 2011 at 0:20
  • add print_r ($result); to the end, then you can find a way to use those variables. Commented Mar 22, 2011 at 0:30
  • The brackets around the $_GET retrieval are unecessary as well. Commented Mar 22, 2011 at 0:49

1 Answer 1

2

I think you should probably read up on PHP: Arrays

Assuming its a simple array (you could clarify this by posting a var_dump($result).

foreach($result as $data) {
 echo '<div>';
 echo $data;
 echo '</div>';
}
answered Mar 22, 2011 at 0:24
Sign up to request clarification or add additional context in comments.

1 Comment

Even if it isn't an array, if it is some sort of iterator / object-y thing you could always foreach it as is or do: $result = (array) $new->product($nice)->show(array('salePrice','url'))->query();

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.