php-general | 2001072
Date: 07/17/01
- Next message: Pétur Björn Thorsteinsson: "Re: [PHP] running php scripts"
- Previous message: Reuben D Budiardja: "[PHP] Get filename in php command line"
- Maybe in reply to: Jeroen Olthof: "[PHP] regexp. king needed (is it possible ???)"
- Next in thread: Jeroen Olthof: "Re: [PHP] regexp. king needed (is it possible ???)"
- Reply: Jeroen Olthof: "Re: [PHP] regexp. king needed (is it possible ???)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
<?
$s = 'somthing opentag1 .........any content in between
.............. closetag1 somthing else';
$opentag = 'opentag1';
$closetag = 'closetag1';
$other_content = 'the other content';
$content = ereg_replace(".*$opentag", '',
ereg_replace("$closetag.*", '', $s));
$new_str = ereg_replace("$opentag.*$closetag", "$opentag
$other_content $closetag", $s);
// $content = ' .........any content in between .............. ';
// $new_str = 'somthing opentag1 the other content closetag1 somthing
else'
?>
$content = '<?=$content?>';<br>
$new_str = '<?=$new_str?>'
> -----Original Message-----
> From: Jeroen Olthof [mailto:j.olthof <email protected>]
> Sent: 17 iulie 2001 17:38
> To: php-general <email protected>
> Subject: [PHP] regexp. king needed (is it possible ???)
>
>
> ereg_replace("$opentag([^*]*)$closetag",
> $this->OPENTAG.$loopHandle.$this->CLOSETAG, $template);
>
> how do I get al hold on the "\\1" part of the replacement.
> basicly I want to replace
>
> opentag1 .........any content in between .............. closetag1
>
> with
>
> opentag2 onewordonly closetag2
>
> but still need the
>
> .........any content in between ..............
>
> is this possible in some way ???
>
> kind regards
> Jeroen Olthof
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe <email protected>
> For additional commands, e-mail: php-general-help <email protected>
> To contact the list administrators, e-mail:
> php-list-admin <email protected>
>
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Pétur Björn Thorsteinsson: "Re: [PHP] running php scripts"
- Previous message: Reuben D Budiardja: "[PHP] Get filename in php command line"
- Maybe in reply to: Jeroen Olthof: "[PHP] regexp. king needed (is it possible ???)"
- Next in thread: Jeroen Olthof: "Re: [PHP] regexp. king needed (is it possible ???)"
- Reply: Jeroen Olthof: "Re: [PHP] regexp. king needed (is it possible ???)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

