Refresh User Data in Joomla

I was busy with a custom component in Joomla, and it stored it’s own user_details based off of the main users table, but if the details were changed then I needed the system to update the session to reflect the changes. This is what I did: $user = JFactory::getUser(); $session Read more…

By Andrew Odendaal, ago

Extract email addresses from a string – PHP

Sometimes you need to extract multiple email addresses from a string and the following function will make all your dreams come true. [code lang=”php”] function extract_emails_from($string){ preg_match_all(“/[\._a-zA-Z0-9-][email protected][\._a-zA-Z0-9-]+/i”, $string, $matches); return $matches[0]; } [/code] ..and this is how you use it: [code lang=”php”] $text = “this is some text and here Read more…

By Andrew Odendaal, ago