Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a little php regex help needed 1

Status
Not open for further replies.

pushyr

Programmer
Jul 2, 2007
159
GB
i have the following url string...


within the sting i would like to preg_match 'plumbing+service'

i have the following code that results in 'keywords=plumbing+service&' ....

Code:
preg_match('#keyword(.*?)&#', $page_urls[$i], $matched_param_keywords);

how would i modify it to just get 'plumbing+service' ?
 
Hi

Code:
preg_match('#keyword[red]s=[/red](.*?)[red]([/red]&[red]|$)[/red]#', $page_urls[$i], $matched_param_keywords);

echo $matched_param_keywords[1]; [gray]// outputs : plumbing+service[/gray]


Feherke.
 
hi feherke, your regex gives me the same result... keywords=plumbing+service&
 
sorry feherke... i was doing this...

$matched_param_keywords[0] instead of this...

$matched_param_keywords[1]

yeah, work great... many thanks!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top