Jump to content

Vbulletin Question - CODE Tags - explode $code by \n


doa24uk

Recommended Posts

Hi guys,

 

I've been wondering....

 

Is it possible to take the $code variable (used to store the text between the

[code*] tags) and explode it by \n (newline) characters

for example

First Line
Second Line
Third Line

 

<?php
$codelines = explode("\n", $code); // or \r\n if it uses this instead
echo "First line = $codelines[0]<br>";
echo "Second line = $codelines[1]<br>";
echo "Third line = $codelines[2]<br>";
?>

If so, where would I put it to be useful on the showthread page??

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.