Skip to content

Instantly share code, notes, and snippets.

@quantumJLBass
Last active December 24, 2015 20:29
Show Gist options
  • Save quantumJLBass/6858006 to your computer and use it in GitHub Desktop.
Save quantumJLBass/6858006 to your computer and use it in GitHub Desktop.
General php snippets -- side notes, you can test things or use as scratch paper, this php code testing site http://sandbox.onlinephpfunctions.com/

Quick copy past list

####pull from editor to for quickkeying####

regex string lowwer

$str='<taxonomy alias="Abnormal dreams" name="Abnormal dreams" taxonomy_type="adverse_events" content=""/>';

$text = preg_replace_callback('/alias="(.*?)"/im',"toLower",$str);
echo $text;
function toLower($matches){
  return 'alias="'.str_replace(' ','-',strtolower($matches[1])).'"';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment