Re: String delimeters, arg!
| From: | James, Yz | Date: | Tue, 01 May 2001 21:44:05 +0000 |
| Subject: | Re: String delimeters, arg! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-51032@lists.php.net to get a copy of this message | ||
Hi Nick,
to delete a cookie, simply use set_cookie("cookie_name"); without appending
any values.
Possible solutions for the \t and \n :
For \n to <br>, use:
$string = nl2br($string);
Not sure whether or not there a similar function for \t, though you could
perhaps use some method to replace \t with * 4. I'm not sure
something like:
$string = ereg_replace("\t", " ",
$string);
would be too clever, just in case someone typed \t rather than ereg_replace
/ preg_replace recognising it as a Tab.
It's getting too late to do any serious thinking. :)
James.
""Nick"" <wizz1@home.com> wrote in message
news:005601c0d275$bfc88510$4c8d7018@cr279859a...
Hello PHP'ers
I am having a problem with string delimiters. For some reason no matter what
I do I can not get them to process correctly!!
For example,
<?
$area_entered = "yes";
$date_entered = "no";
echo "$area_entered\t\t\t$date_entered<br>";
?>
That outputs:
yes no
What am I doing wrong?! Is there something I need to set in the php.ini
file? I would like to be able to type \n instead of <br> repeatidly!
Also, when working with cookies, if I have a cookie that is set by,
if (!isset($cookies)) {
//Set Cookies
$cookie_user = setcookie ("username", $row["user"], time()+86400, "/",
"localhost");
$cookie_pass = setcookie ("password", $row["pass"], time()+86400, "/",
"localhost");
$cookie_step = setcookie ("step", "1", time()+86400, "/",
"localhost");
$cookies_set = setcookie ("cookies", "y", time()+86400, "/",
"localhost");
}
Is there a way to unset the cookie? Perhaps by,
$cookie_set = setcookie ("cookies","");
?
Thanks for your time,
Nick