Skip to content

Instantly share code, notes, and snippets.

@kid-icarus
Created July 31, 2012 23:39
Show Gist options
  • Save kid-icarus/3221734 to your computer and use it in GitHub Desktop.
Save kid-icarus/3221734 to your computer and use it in GitHub Desktop.
For lindsayo
<?php
$matches = array();
$string = ' one two';
$number_of_matches = preg_match('/\s*(.*)/', $string, $matches);
print_r($matches);
$replacement_awesomeness = preg_replace('/\s/','-', $matches['1']);
print $replacement_awesomeness;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment