Created
December 1, 2013 18:17
-
-
Save kurudrive/7738772 to your computer and use it in GitHub Desktop.
php の文字列置換例文
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
$subject = '<div id="pickId_4046"></div><div id="pickId_3077"></div><div class="888"></div>'; | |
$subject = esc_html(file_get_contents( site_url() )); | |
$not_in_array = ''; | |
$pattern = '/id="pickId_([0-9]+)"/'; | |
preg_match_all($pattern,$subject,$out, PREG_PATTERN_ORDER); | |
$not_in_array = $out[1]; // [0]はマッチした条件部分の配列 | |
print '<pre>';print_r($not_in_array);print '</pre>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment