Hi,
I haven't done much php before. Im using PHP 4.2
I have a file which looks like
[UserFile]
Password=202cb962ac59075b964b07152d234b70
Company=test
Account=rwe111
Language=polish
Partner=Customer
I would like to replace the language with Polish.
I have my two values
$language = polish
$nlanguage = english
I have hunted around for a solution but they seem to throw errors on the preg_match because of the Lanuage=polish.
Would anybody be able to point me in the right direction?
Thank you very much in advance.
Replacing a value in a flat file
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Replacing a value in a flat file
If those are the only requirements, this should work:
Code: Select all
$text = str_replace("Language=$language", "Language=$nlanguage", $text);mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.