Link to home
Start Free TrialLog in
Avatar of parpaitas
parpaitas

asked on

str_replace = i need to remove an empty line from my string PLS HELP

My string contains an extra empty line, how can i remove it or replace it?

I am using a .php code for this and i can't make it work
$mystring str_replace("/n","",$mystring)
echo $mystring;

Thanks
Avatar of shdwmage
shdwmage
Flag of United States of America image

This is what I use to remove all carriage returns in my input.

function data_correction($beta) {
	//this function is used to replace data copied and pasted from excel to make it into a useable format.
	$newstr = str_replace("\r\n", ",", $beta);
	return $newstr;
};

Open in new window


I paste information from excel and I don't like to seperate it into commas.  Hope that helps.
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial