The img Image address in the regular article content and the connection address in the regular content. This example describes how to use the regular expression in php to obtain what we want, the above example is to put all the link addresses and image addresses of the document content string. this example mainly describes how to use the regular expression in php to obtain what we want, the above example is to take out all the link addresses and image addresses of the document content string, so it is much more convenient to use regular expressions.
The img Image address in the regular article content and the connection address in the regular content
$ Body = '';
$ Link = 'tutorial on creating fdas webpages ';
$ Array = "aa, bb, cc, ee, ff, ss, ffa, ees, fde, MCM ";
$ V = explode (',', $ array );
If (is_array ($ v ))
{
$ Vlen = sizeof ($ v)-1;
$ Mt = mt_rand (1, $ vlen );
$ Motype = $ v [$ mt];
}
Else
{
$ Motype = $ array;
}
$ Link = preg_match_all ('/preg_match_all ("/(src | SRC) = [" |' |] {0,} (Image /(. *). (gif | jpg | jpeg | png | bmp)/isU ", $ body, $ img_array );
Print_r ($ img_array [2] [0]);
Echo'
';
Echo $ link_array [2] [0];
This example mainly describes how to use php to get what we want. the above example is to retrieve all the link addresses and image addresses of the document content string, it is much easier for us to use regular expressions.
This site's original tutorial, reprinted with the source www. bKjia. c0m
...