function issue
Posted: Sun Jul 27, 2003 9:38 am
I received some help from pootergiest on this forum for stripping line breaks from my arrays.. problem is , Im having trouble creating a function out of it.
Below is the original few lines of code. which work
below is my attempt at making a function out of it. it doesnt work!
gives me the result which is entry_0 with the line break!
Im definately doing something wrong..and I also apologise for being such a newbie amongst the ranks of seasoned developers.. Ive tried most of the stuff Ive found on tutorials/forums before posting here.
Any help on fixing this function would be greatly appreciated..
cheers!
Below is the original few lines of code. which work
Code: Select all
//this bit assigns the array element to a var.
$entry_0=($entries[0][entrymsg]);
//This bit strips off extra line breaks.
$entry_0 = str_replace('
','', trim($entry_0));
//hardcoded line break neccessary.below is my attempt at making a function out of it. it doesnt work!
Code: Select all
function striplb($tempentry)
{
$tempentry = str_replace('
','', trim($tempentry));
return $tempentry;
}
$entry_0=($entries[0][entrymsg]);
striplb($entry_0);
print($entry_0);Any help on fixing this function would be greatly appreciated..
cheers!