Current location: Hot Scripts Forums » Programming Languages » PHP » preg_match all question


preg_match all question

Reply
  #1 (permalink)  
Old 07-28-09, 10:57 AM
naissa naissa is offline
Wannabe Coder
 
Join Date: Jul 2004
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
preg_match all question

I have a question.

I used the following PHP code:
PHP Code:

$regexp '#<div class="number value">(?<name>(.*?))</div>#si'
what does the (?<name> do?? and is the ? necessary?

Thanks,
Weina Scott
Reply With Quote
  #2 (permalink)  
Old 07-28-09, 11:23 AM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
My first thought is that it's an assertion, but I'm not super keen on this aspect of PCRE.
__________________
The toxic ZCE
Reply With Quote
  #3 (permalink)  
Old 07-28-09, 01:05 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
I think this will assign a more specific array key. So rather than $result[1] it'll be $result['name'].
Reply With Quote
  #4 (permalink)  
Old 07-29-09, 02:03 PM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
__________________
The toxic ZCE
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie member, (semi)novice developer has a question WorkyMcWorkerson Script Requests 2 11-26-08 01:28 PM
Injecting a string into an If Statement ? nova912 PHP 4 07-21-06 02:04 PM
Posting a question / answer on site markcody PHP 2 11-23-04 01:58 PM
question and answer software jaydifox C/C++ 0 02-21-04 09:26 AM


All times are GMT -5. The time now is 07:55 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.