Menu

PHP code highlighting bug

2007-10-11
2012-11-13
  • Nobody/Anonymous

    Hi,

    start Notepad++, switch the language to PHP and paste this piece of PHP code:

    <CUT>
    <?
                        break;
                }
            }
            if($i==1){
                ?>            </DataItem>
            </DataItemCollection>           
    <?
            }
        }
        ?>    </DataItemGroup>
    </DataDefinition>
    <?
        $xml=ob_get_clean();
        resetBuffer($buffer);
        return $xml;
    }

    ?>
    </CUT>

    Ok, it's not a working code, there's something missing at the beginning - but even if I'd post the full code, the code highlighting would stop at this line:

    <CUT>
        ?>    </DataItemGroup>
    </CUT>

    Any suggestions?

    Regards,
    nd

     
    • Nobody/Anonymous

      try using <?php %)
      inserting 4 any symbols (spaces for example) after <? also helps... don't know why %)

       
    • CodeNexus

      CodeNexus - 2007-10-13

      There is another really good reason to use <?php to open your tags rather than just the short tag <?.

      Not all servers support php short tags.  It is shocking I know but there you go.  If you want your code to be at all able to work on another server with as little pain as possible then I suggest changing all <? to <?php.

      Hey and guess what.  It isn't going to be as painful as you think!  Notepad++ has a "find and replace on all open documents" feature!  :-D

      Enjoy.

       
MongoDB Logo MongoDB