Help preserving sentence structure

Help preserving sentence structure

am 26.02.2010 21:11:01 von John Tamm-Buckle

--0016e64c1f489cf3600480867fc5
Content-Type: text/plain; charset=ISO-8859-1

Hi, new to this list...

I'm adapting some code that generates text and want to keep the syntax. In
the original version the output was iterated from an array in

 tags.
That was fine for what it was, but it's now a word press plugin and the
 tags get in the way.  How do I keep the sentence structure without
using
s?  Also, I'm quite new to PHP in general... :)  Any help would
be much appreciated!

Below is an extract of the code with some highlighting for emphasis:

function wpm_display_generator() {

if (isset($_POST['submit_button'])) {

// the form was submitted to this script - generate
// and display
require_once 'lib/generator.php';
require_once "lib/util.php";
require_once "lib/vocabulary.php";
require_once "lib/widgets.php";

$vocab = Vocabulary::getInstance();
$cats = $vocab->getCategories();
$catName = '';
$sentence = '';
if (isset($_POST['category_choice'])) {
$catName = $cats[$_POST['category_choice']];
$gen = new wordGenerator($_POST['category_choice'],
$_POST['length_choice']);
$lines = $gen->generate();
foreach ($lines as $line) {
$sentence .= "
" . $line . "
";
}
}

require 'sentence.php';
}
else {
require 'generator_form.php';
}
}


Many thanks,

John

--
Out now:
Kvist 002 - Raglani - Web of Light - 12"
Kvist 003 - EOD - untitled - 12"
Kvist 004 - JD Emmanuel - Solid Dawn - CD
Kvist 005 - Guillaume Gargaud - Here - CD

Coming soon:
Kvist 006 - Tom Hamilton - Pieces for Kohn/Formal & Informal Music - CD

www.kvistrecords.com

--0016e64c1f489cf3600480867fc5--

Re: Help preserving sentence structure

am 26.02.2010 23:59:37 von Ryan Sun

http://us.php.net/manual/en/function.htmlentities.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php