I've written a code in a WP_Query to converting a string (the_content) to an array (choices). But it seems wrong! In fact, the choices array is empty after each loop. However str string is notnull. How can i handle this array to be nutnull? Any help would be appreciated.
$first_query = new WP_Query( $args ); while ($first_query->have_posts()) : $first_query->the_post(); the_title(); //echo the title the_content(); //echo the content $str = the_content(); $choices = explode("-",$str); var_dump($choices); endwhile;