Created
December 26, 2016 09:00
-
-
Save al5dy/42ef3e1aeac139fa971531d0d55afeea to your computer and use it in GitHub Desktop.
Универсальное добавление класса "table" в <table>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( false !== strpos( $content, '<table' ) ) { | |
$rep = preg_replace('~<table\K(?:[^>]*?\K(\s?)class="([^"]*)")?~', ' class="$2$1table"', $rep); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment