Evening all!
Sorry if its a faq of some sort, but I haven't found an answer to this as
yet.
I'm trying to write a function which will go and get data out of a database
and lay it out. The awkward bit is that I want to be able to vary the
layout: I want to be able to pass a string to the function to define the
layout.
So in the simplest form of the situation (ignoring the database bit) I want
to be able to do something like
function myshow($x)
{ $Text = "wibble";
echo $x;
}
myshow("This is \$Text \n");
myshow("And so is this.... \$Text !!!")
and get the output
This is wibble
And so is this.... wibble !!!
I can't get it to work - is it possible, perhaps with some manipulation of
the syntax of the string?
--
David Aldred
Sorry if its a faq of some sort, but I haven't found an answer to this as
yet.
I'm trying to write a function which will go and get data out of a database
and lay it out. The awkward bit is that I want to be able to vary the
layout: I want to be able to pass a string to the function to define the
layout.
So in the simplest form of the situation (ignoring the database bit) I want
to be able to do something like
function myshow($x)
{ $Text = "wibble";
echo $x;
}
myshow("This is \$Text \n");
myshow("And so is this.... \$Text !!!")
and get the output
This is wibble
And so is this.... wibble !!!
I can't get it to work - is it possible, perhaps with some manipulation of
the syntax of the string?
--
David Aldred
Comment