...Or you could preg_match on the string.
$data = <a href="javascript:void(EXTERNALLINK('102'))">
preg_match('/EXTERNALLINK\(\'(\d+)\'\)/', $data, $matches);
var_dump($matches);
---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515
> -----Original Message-----
> From: R.S. Herhuth [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 15, 2002 10:20 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Return portion of a string
>
>
>
> I have an instance where I have an article ($article) that may or may
> not contain:
>
> <a href="javascript:void(EXTERNALLINK('102'))">
>
> There might be many occurrances of this substring in exactly the same
> format but the id's will be unique with each occurance.
>
> Can someone please show me how to extract the id's (in this case the
> 102) of the above string into an array? I have been through the
> documentation on substrings and regular expressions but I'm just not
> getting it.
>
> Thanks,
> Ron
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php