Jump to content

Help processing two or more variables in one variable? Please :(


Cface

Recommended Posts

I really hope someone can help me out! Maybe i'll learn a thing or two.

So i got ahold of this bbcode2html parser (attached below). It works fine and all when you run only one variable through it, but when i try to run two or more only one shows up, and not where it should show up on the page.

 

Here's what i tried doing in getting it to work with two variables.

This goes on main page.

<?php
require_once('access/blocks/parser/parser.php');
$parser = new parser;
$parsed = $parser->p($text, 1 . $text2, 1);  // default is $parsed = $parser->p($text, 1); 1 being an argument. 
echo $parsed;
?>

 

Then i broke up the main page into sections (i.e. news.php, nav.php, shoutbox.php, etc) using the include method and put this bit of code on each page, changing  var to $text2, $text3, etc. on the different pages:

<?php
$text = "[url=index.php]link 1[/url]
[url=link2.php]link 2[/url]";
?> 

 

It works fine when i'm just using one $text variable but when i use two or more it farts up. This is what happened on a test site when i tried running two vars. It ignored $text2 and threw $text one all the way out of whack on top, nowhere near where i placed the include. This otherwise works, great running one $text...

 

Anyone have any ideas? Please PHP guru's show me the error of my ways!

 

Much obliged,

Frank

 

[attachment deleted by admin]

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.