# PHP Syntax Highlighting

**URL:** <https://www.phphelp.com/t/php-syntax-highlighting/9533>\
**Category:** Website Announcements\
**Created:** [December 6, 2006, 8:54pm UTC](https://www.phphelp.com/t/php-syntax-highlighting/9533 "2006-12-06T20:54:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peg110](https://www.phphelp.com/letter_avatar_proxy/v4/letter/p/bb73d2/32.png) [@peg110](https://www.phphelp.com/u/peg110)\
**Post date:** [December 6, 2006, 8:54pm UTC](https://www.phphelp.com/t/php-syntax-highlighting/9533/1 "2006-12-06T20:54:03Z")

</div>

Ok… I missed it and don’t know what happened to it before, but I have just brought it back.

The php syntax highlighting is back.

You can use it as you would the CODE tags accept you change it to PHP

the [CODE] Tags would give you this

[code]\<?php

class LogVisitor  
{

```
  // set up the public vars
  public $ipAddress;
  public $userAgent;
  public $timesVisited;

  // Database Vars
  protected $dbserv = 'localhost';
  protected $dbuser = 'root';
  protected $dbpass = NULL;
  protected $dbbase = 'log';

  function LogVisitor()
  {

```

[/code]  
Where the [PHP] Tags give you this  
[php]\<?php

class LogVisitor  
{

```
  // set up the public vars
  public $ipAddress;
  public $userAgent;
  public $timesVisited;

  // Database Vars
  protected $dbserv = 'localhost';
  protected $dbuser = 'root';
  protected $dbpass = NULL;
  protected $dbbase = 'log';

  function LogVisitor()
  {

```

[/php]

Use and Enjoy…

---

<div class="post-metadata">

**Author:** ![Q1712](https://www.phphelp.com/letter_avatar_proxy/v4/letter/q/a183cd/32.png) [@Q1712](https://www.phphelp.com/u/Q1712)\
**Post date:** [September 23, 2007, 3:17pm UTC](https://www.phphelp.com/t/php-syntax-highlighting/9533/2 "2007-09-23T15:17:38Z")

</div>

i havn’t yet found out when the php-syntax highliting is eating or adding the php tags:

```auto
<html><?php echo 'Hello World'; ?></html>
```

[php]\<?php echo 'Hello World'; ?\>[/php]

```auto
<?php echo 'start'; ?><html><?php echo 'Hello World'; ?></html><?php echo 'end'; ?>
```

[php]\<?php echo 'start'; ?\>\<?php echo 'Hello World'; ?\>\<?php echo 'end'; ?\>[/php]

```auto
<?php echo 'start'; ?><html><?php echo 'Hello World'; ?></html>
```

[php]\<?php echo 'start'; ?\>\<?php echo 'Hello World'; ?\>[/php]

```auto
echo 'start'; ?><html><?php echo 'Hello World'; ?></html><?php echo 'end';
```

[php]echo ‘start’; ?\>\<?php echo 'Hello World'; ?\>\<?php echo ‘end’;[/php]

```auto
echo 'Hello World
```

[php]echo 'Hello World[/php]  
(i know there is an synax-error in there)

Does anybody else know? Why and when?

---

<div class="post-metadata">

**Author:** ![peg110](https://www.phphelp.com/letter_avatar_proxy/v4/letter/p/bb73d2/32.png) [@peg110](https://www.phphelp.com/u/peg110)\
**Post date:** [January 3, 2008, 2:04pm UTC](https://www.phphelp.com/t/php-syntax-highlighting/9533/3 "2008-01-03T14:04:00Z")

</div>

Currently with the recent Upgrade (??) to the PHPBB Software to version 3.x, The Mod for PHP Syntax Highlighting is disabled. Thus you should stick to using “CODE” instead of PHP (in the phpBB code formatting)

I will make another post when it’s re-enabled.
