Spintax function not working
-
hello
I tried the spintax function you posted here: https://paste.ee/p/GluOL
and pasted it in the function editor as: (see below)
but it’s not spinning my spintax when I preview ! what should I do ?
<?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;
}
?>
The topic ‘Spintax function not working’ is closed to new replies.