Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP loop with set intervals
    primarykey
    data
    text
    <p>I have the following code that converts my twitter account rss feed into a string so that I can parse my followers user names.</p> <pre><code>$url = file_get_contents("MY_TWITTER_RSS_FEED_URL_GOES_HERE"); $source = simplexml_load_string($url); foreach ($source as $match){ //name of node $username = "&amp;nbsp@".$match-&gt;author-&gt;name; //removes the name and parentheses ex.kyrober555 (Robert) $usernames = substr($username, 0, strpos($username, ' ')); //returns usernames only ex.kyrober555 echo $usernames; } </code></pre> <p>Using the foreach loop I return all 15 names from the feed and it looks like this.</p> <pre><code> @ajay54 @marymary770 @funnigurl1209 @jimiwhitten @kyroberthl @tree_bear @crftyldy @sanbrt63 @Sandra516 @DreamFog @KravenSwagNBzz @DreamFog @TheCrippledDuck @TheCrippledDuck @Cass60 </code></pre> <p>Now here is what I would like to do, but I am not sure if its possible, and I wouldn'y know how so I ask for your help. When I load the page for this php file it returns all user names at once. What I would like to do is return 5 user names then do something then return 5 more then do something else then return the last 5. Maybe something like this but I don't know...</p> <pre><code>foreach ($source as $match){ /* Return the 1st 5 user names */ /* do some other type of coding */ /* Return the second set of 5 usernames */ /* do something here */ /* return the last 5 usernames */ } </code></pre> <p>Ultimately returning all 15 user names, but at different intervals not all at once.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload