Skip to content

Instantly share code, notes, and snippets.

@jcamachott
Last active August 29, 2015 14:25
Show Gist options
  • Save jcamachott/dfddd63605a375f29e77 to your computer and use it in GitHub Desktop.
Save jcamachott/dfddd63605a375f29e77 to your computer and use it in GitHub Desktop.
randomString
<?php
// ver 1.1.20150717
//
// Most recent: https://gist.github.com/jcamachott/dfddd63605a375f29e77
//
// Usage:
// [[randomString? &strings=`one|two|three|four`]]
//
// $strings: string
$stringarray = explode("|", $strings);
$key = array_rand($stringarray);
return $stringarray[$key];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment