title: PHP: get a string inside a particular string
body: <p>I have a lot data into one string and i want to get some particular chunks of data.</p>
  
  <p>Example of my data:</p>
  
  <pre><code>lorem ipsum fashjdf hsakj sdhsdaf something: 'data' jhjkhf akjh fa kjhjhk fdasjh kafsdj hkadf 
  current database: 'databasename' alot of lorem ipsum data current username: 'username'
  and jet more lorem ipsum data and so on
  </code></pre>
  
  <p>Now i want to get the string after "current database" and the one after "current username". BUT i want to assign them to the strings $database and $username.</p>
  
  <p>I know there is a regular expression like </p>
  
  <pre><code>preg_match_all("/'(\w*)'/", $output, $result);
  </code></pre>
  
  <p>But in the lorem ipsum-data there is a lot of other text with quotes. And i just want to get only thoose two strings and assign them to there variables.</p>
  
  <p>Does anyone please can help me to figure this out.</p>