RE: [PHP3] Regex fun :) From: Boget, Chris (chris <email protected>)
Date: 11/30/99

> I need help!!!
> i have a string like so
> $string = "<select name=seleckbox
> size=1>\n<option>one\n<option>two\n</option>";
> and i need to insert "\n<option>Any" between "...size=1>" and
> "\n<opti...".
> i have been trying for ages to get the correct ereg_replace
> code but i have now got a hugh headache.
> the select name and size value are not constant.

It's really hard to tell what else is going on around
setting the above select box. But one avenue you
can explore is the following:

$selectBoxName = "bob"
$selectBoxSize = 10;

$string = "<select name=\"$selectBoxName\"
                   size=\"$selectBoxSize\">\n<option>one\n
                   <option>two\n</option>";

And just dynamically modify those two variables
in your code. You have to already have the variables
you are going to replace there in order to actually do
the ereg_replace you are hoping to find.

HTH

Chris

-- 
PHP 3 Mailing List <http://www.php.net/>
To unsubscribe, send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest, e-mail: php3-digest-subscribe <email protected>
To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
To contact the list administrators, e-mail: php-list-admin <email protected>