Hi Everyone,
I was just coding a small mockup example from someone on the PHP forum and it just occurred to be that DaniWeb's code tags will only highlight in one language (To my knowledge). This is somewhat annoying since most PHP files can contain HTML and only one can be highlighted. Are there any plans to include the option of multiple language CODE tags or is there already a way to do this?
Thanks,
PMC

Recommended Answers

All 4 Replies

You can specify the language, such as [code=html]. I don't know if you can successfully specify more than one language in the same post -- you'll just have to try it and find out what it does.

Yeah, I was guessing that something like this didn't work. It's a shame too, because multi-language highlighting in a single code block would be pretty cool.

You know I'll try it:

<html>
<head>
<title>CODE Tag Test</title>
</head>
<body>
<?php
//Comment
echo "String!";
mysql_connect("localhost", "user", "pass") or die(mysql_error());
$b = 6;
$a  = $b++;
class dummy { private $value; }
include("text.php");
?>
</body>
</html>

EDIT: Well it looks like it doesn't work. Oh well! Thanks anyways.

I don't think it's currently possible, but it seems feasible and it would be a great idea.

I thought you meant something like this:

<html>
<head>
<title>CODE Tag Test</title>
</head>
<body>
<?php
//Comment
echo "String!";
mysql_connect("localhost", "user", "pass") or die(mysql_error());
$b = 6;
$a  = $b++;
class dummy { private $value; }
include("text.php");
?>
</body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.