Use regex to extract integer from url in a string with php -


मेरे पास एक यूआरएल है जैसे नीचे दिए गए उदाहरण

  http://www.website .com / page.php? Pid = 263547322425 और amp; foo = भी  

मैं pid का मूल्य प्राप्त करने के लिए regex का उपयोग कैसे कर सकता / सकती हूं? पीड = के अंत से मूल्य को & amp;?

<पूर्व> $ matches = सरणी (); अगर (preg_match ('/ pid = (\ d +) /', $ url, $ मैच)) {$ matches [1]; // pid मान}

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -