note 49082 added to function.str-replace
| From: | c dot k at radiogong dot com | Date: | Sun, 16 Jan 2005 09:41:50 +0000 |
| Subject: | note 49082 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-83401@lists.php.net to get a copy of this message | ||
I made a mistake. This code is right:
<?php
class parser{ //This is the class
var $data;
function pub(){
global $index;
$file = $this->data;
$dat = implode('', file($file));
foreach($index as $key => $value)$dat=str_replace('{'.$key.'}',$value,$dat);
echo $dat;
}
}
function output($dat)
{
// This function makes the using of this script easier
$parser = new parser;
$parser->datei = $dat;
$parser->pub();
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.str-replace.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+49082
Delete -- http://master.php.net/manage/user-notes.php?action=delete+49082&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49082&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+49082&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+49082&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+49082&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+49082&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+49082&report=yes
Search -- http://master.php.net/manage/user-notes.php