Re: replace single slash with double slash
- From: gosha bine <stereofrog@xxxxxxxxx>
- Date: Sat, 22 Sep 2007 21:43:47 +0200
dkirkdrei@xxxxxxxxx wrote:
the code:
<?
$var = "\\wusais\Intranets\Intranets\fpdb\pdf\weinig\00505882.pdf";
echo strtr($var, array('\\' => '\\\\'));
?>
produces this:
\\wusais\\Intranets\\Intranets\\fpdb\\pdf\\weinig05882.pdf
close but the end is still killing me...
If the string is coming from DB as you have said, you shouldn't be assigning it to $var, but fetch it from the database instead, like this:
$rc = mysql_query("SELECT .....");
$row = mysql_fetch_array($rc);
$var = $row['fieldname'];
echo strtr($var, array('\\' => '\\\\'));
--
gosha bine
extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
.
- Follow-Ups:
- Re: replace single slash with double slash
- From: dkirkdrei
- Re: replace single slash with double slash
- References:
- replace single slash with double slash
- From: dkirkdrei
- Re: replace single slash with double slash
- From: gosha bine
- Re: replace single slash with double slash
- From: dkirkdrei
- Re: replace single slash with double slash
- From: gosha bine
- Re: replace single slash with double slash
- From: dkirkdrei
- replace single slash with double slash
- Prev by Date: Re: mb_language() problem - php.ini settings?
- Next by Date: Re: Accessing POP3 Mail in PHP
- Previous by thread: Re: replace single slash with double slash
- Next by thread: Re: replace single slash with double slash
- Index(es):
Relevant Pages
|