<?php
$a[0]=0;
$a[1]=1;
echo("a is $a"); //this will tell "a is array"
$b[0]=0;
$b[1]=1;
$b=trim(str_replace("'", "''", $b));
echo("<br>b is $b"); //this will tell "b is array" but actually, $b array is damaged.
for ($index=0; $index<count($a); $index++)
{
echo("<br>a $a[$index]"); //this will display array $a value
}
for ($index=0; $index<count($b); $index++)
{
echo("<br>b $b[$index]"); //this cannot display $b value
}
?>
the screen will be
a is Array
b is Array
a 0
a 1
b A
So my question if i accidently apply string function to an array, it will damage the array. Right?