title: How to get specific occurences of a string in a text and put it in an array?
body: <p>I have a long text which contains:  </p>
  
  <pre><code>city_nameLAcity_name some text here and there ;) city_nameLondoncity_name some other text will goes here too then city_nameTehrancity_name and of course some other junk text here.
  </code></pre>
  
  <p>I want to slurp LA, London, and Tehran from the text above. I ereg, but couldn't get what I want I used something like below:  </p>
  
  <pre><code>ereg ("city_name(.*)city_name", $longText, $output);
  </code></pre>
  
  <p>How to do this job? I appreciate your inputs!</p>