<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=PHP%2FString%2Fsubstr_replace</id>
		<title>PHP/String/substr replace - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=PHP%2FString%2Fsubstr_replace"/>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=PHP/String/substr_replace&amp;action=history"/>
		<updated>2026-04-04T13:25:12Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://wbex.ru/index.php?title=PHP/String/substr_replace&amp;diff=1432&amp;oldid=prev</id>
		<title> в 10:37, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=PHP/String/substr_replace&amp;diff=1432&amp;oldid=prev"/>
				<updated>2010-05-26T10:37:30Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 10:37, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://wbex.ru/index.php?title=PHP/String/substr_replace&amp;diff=1433&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=PHP/String/substr_replace&amp;diff=1433&amp;oldid=prev"/>
				<updated>2010-05-26T07:07:41Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==By supplying no start or length arguments, the string will be added to the beginning==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $mystring = substr_replace(&amp;quot;Hello World&amp;quot;, &amp;quot;H3110 W0r1d!&amp;quot;, 0, 0);&lt;br /&gt;
  echo $mystring . &amp;quot;&amp;lt;br /&amp;gt;&amp;quot;; //Echos H3110 W0r1d!Hello World&lt;br /&gt;
  &lt;br /&gt;
  $mystring = substr_replace(&amp;quot;Hello World&amp;quot;, &amp;quot;0 w0&amp;quot;, 4, 4);&lt;br /&gt;
  echo $mystring; //Echos Hell0 w0rld.&lt;br /&gt;
  &lt;br /&gt;
?&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PHP has two main functions for performing simple search-and-replace operations. The first one is substr_replace==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
    $haystack = &amp;quot;this is a test&amp;quot;;&lt;br /&gt;
    $newstr = substr_replace ($haystack, &amp;quot;sad&amp;quot;, 6, 5); &lt;br /&gt;
    echo &amp;quot;$newstr\n&amp;quot;;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Replacing a Portion of a String Using substr_replace()==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;?&lt;br /&gt;
    $membership = &amp;quot;asdfasdf&amp;quot;;&lt;br /&gt;
    $membership = substr_replace( $membership, &amp;quot;00&amp;quot;, 2, 2);&lt;br /&gt;
    print &amp;quot;New membership number: $membership&amp;lt;br/&amp;gt;&amp;quot;;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Replacing a substring with substr_replace()==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
$new_string = substr_replace($old_string,$new_substring,$start);&lt;br /&gt;
$new_string = substr_replace($old_string,$new_substring,$start,$length);&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Replacing Substrings: string substr_replace ( string str, string replacmnt, int start [, int len] )==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;?php &lt;br /&gt;
$mystring = substr_replace(&amp;quot;Hello World&amp;quot;, &amp;quot;asdf&amp;quot;, 0, 0); &lt;br /&gt;
echo $mystring . &amp;quot;&amp;lt;br /&amp;gt;&amp;quot;; &lt;br /&gt;
$mystring = substr_replace(&amp;quot;Hello World&amp;quot;, &amp;quot;0 w0&amp;quot;, 4, 4); &lt;br /&gt;
echo $mystring; &lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==substr_replace() function replaces the string with replacement.==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Its syntax is: string substr_replace (string string, string replacement, int start [, int length])&lt;br /&gt;
If start is positive, replacement starts at character start.&lt;br /&gt;
If start is negative, replacement starts at (string length - start).&lt;br /&gt;
If length is positive, replacement will be length characters long.&lt;br /&gt;
If length is negative, replacement will end at (string length - length) characters.&lt;br /&gt;
&amp;lt;?&lt;br /&gt;
$favs = &amp;quot;is good&amp;quot;;&lt;br /&gt;
$name = &amp;quot;A&amp;quot;;&lt;br /&gt;
$favs = substr_replace($favs, $name, 0, 0);&lt;br /&gt;
print $favs;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==substr_replace.php==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
   $ccnumber = &amp;quot;1234567899991111&amp;quot;;&lt;br /&gt;
   echo substr_replace($ccnumber,&amp;quot;************&amp;quot;,0,12);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>