I have a lot data into one string and i want to get some particular chunks of data.
Example of my data:
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
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.
I know there is a regular expression like
preg_match_all("/'(\w*)'/", $output, $result);
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.
Does anyone please can help me to figure this out.