Home  >  Article  >  Backend Development  >  PHP code to extract ID from Taobao URL_PHP tutorial

PHP code to extract ID from Taobao URL_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 16:12:21983browse

Copy code The code is as follows:

$taobao = 'taobao.com';
$tmall = 'tmall.com';
$guojitmall = 'tmall.hk';
$ juhuasuan = 'ju.taobao.com';

/*
Get the baby’s id

Leisure e-family

*/
function quid($strurl) {
$strurl = strtolower ( $strurl );
if (strpos ( $strurl, 'id' ) !== false) {
$arr = explode ( '?', $strurl );
$arr = explode ( '&', $arr [1] );
$NO = 0;
foreach ( $arr as $k => $v ) {
                                                                                                                                                                                                                                                                                           >                                                                                                                                                                                                                                                                                          //echo $v,'
';
                                                                                                                                             >                                                                                                                                                                                                                                                                                                                      >                                                                                          
if (is_numeric ( $str )) {
                                                                                                    } else if ($NO == 0 || ($x > 9 && $x < ; 11)) {
                                                                                                                                                                                                                                                                     🎜>}
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/313662.htmlTechArticleCopy the code as follows: ?php $taobao = 'taobao.com'; $tmall = 'tmall.com' ; $guojitmall = 'tmall.hk'; $juhuasuan = 'ju.taobao.com'; /* Get the baby's id Casual e-family*/ function quid(...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn