|
Posted by Curt Zirzow on 11/16/05 06:36
On Wed, Nov 16, 2005 at 01:27:12AM +0200, Robin Vickery wrote:
> On 11/15/05, Greg Donald <destiney@destiney.com> wrote:
> > On Tue, 15 Nov 2005, Jim Moseby wrote:
> >
> > >> for file in *.php; do
> > >> cp $file $file.tmp
> > >> sed -e "s/<?$/<?php/g" $file.tmp >$file
> > >> rm $file.tmp
> > >> done
> > ...
> >
> > for file in *.php; do
> > cp $file $file.tmp
> > php -r 'echo preg_replace("/<\?php=\s*/i","<?php echo
> > ",preg_replace("/<\?(?!php)/i","<?php",file_get_contents($argv[1])));'
> > $file.tmp >$file
> > rm $file.tmp
> > done
> ...
> $token = token_get_all($source);
>
> foreach ($token as $t) {
> if (is_string($t)) {
> print $t;
> continue;
> }
>
> switch ($t[0]) {
> case T_OPEN_TAG_WITH_ECHO:
> print '<?php echo ';
> break;
> ...
This is a good finale for this thread!!
Curt.
--
Navigation:
[Reply to this message]
|