Surprise! We've been running on hardware provided by BuyVM for a few months and wanted to show them a little appreciation.
Running a paste site comes with unique challenges, ones that aren't always obvious and hard to control. As such, BuyVM offered us a home where we could worry less about the hosting side of things and focus on maintaining a clean and useful service! Go check them out and show them some love!
Description: Spintax Function
Submitted on November 14, 2017 at 03:50 PM

New Paste 1 (PHP)

function my_spintax( $string ) {
	$data = preg_match_all( "/(?=\{).*?(?=\})./", $string, $match );
	
	if ( !empty( $match ) ) {
		foreach ( $match as $key => $value ) {
			if ( !empty( $value ) ) {
				foreach ( $value as $values ) {
					$v = explode( "|", $values );
					$i = array_rand( $v );
					$string = str_replace( $values, str_replace( array( "{", "}" ), "", $v[ $i ] ), $string );
				}
			}
		}
	}
	return $string;
}