Home  >  Q&A  >  body text

Ask a question about regular expressions

<?php
$a=12;
$reg='/1*/';
preg_match_all( $reg, $a, $match);
var_dump($match);
exit;

//Output result

array(1) {

[0]=>

array(3) {

[0]=>

string(1) "1"

[1]=>

string(0) ""

[2]=>

string(0) ""

}

}


Why is it output 3 subscripts? Where did the third subscript come from?


额……额……2199 days ago884

reply all(0)I'll reply

No reply
  • Cancelreply