Skip to content

Instantly share code, notes, and snippets.

@mcsee

mcsee/stringabuser.php

Last active Oct 22, 2020
Embed
What would you like to do?
<?
$schoolDescription = 'College of Springfield';
preg_match('/[^ ]*$/', $schoolDescription, $results);
$location = $results[0]; // $location = 'Springfield'.
$school = preg_split('/[\s,]+/', $schoolDescription, 3)[0]; //'College'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment