Thread: autoindention
View Single Post
Old May 13th, 2006, 10:59 AM   #1
a thing
Unverified User
 
a thing's Avatar
 
Join Date: Aug 2005
Location: none
Posts: 146
Rep Power: 0 a thing is on a distinguished road
autoindention

Is there a way I can get PHP to automatically correctly indent something? For example, make
[php]<?php echo("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>testing PHP</title>
</head>
<body>
<?php
echo("test 1<br/>\n");
echo("test 2\n");
?>
</body>
</html>[/php]

output
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
	<head>
		<title>testing PHP</title>
	</head>
	<body>
		test 1<br/>
		test 2
	</body>
</html>

instead of
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
	<head>
		<title>testing PHP</title>
	</head>
	<body>
		test 1<br/>
test 2
	</body>
</html>
__________________
Warning: My posts may change (dramatically) within the first 15 minutes they're posted.
Got 'Nux?—GNU/Linux and other free software support.
It's GNU/Linux, not just Linux.
a thing is offline   Reply With Quote