I have this very simple Wordpress while loop:
$loop = new WP_Query( args ) );
while ( $loop->have_posts() ) : $loop->the_post();
$data = grab_something( args );
echo $data;
echo "<br/";
endwhile;
This gives me something like:
datastring1
datastring2
anotherdata
somethingelse
and else
and so forth
(...)
I want to save these values from while loop as an array or variables, eg.
$data1 = "datastring1";
$data2 = "datastring2";
$data3 = "anotherdata";
(...)
How to? :)
Thanks!