Q:

php remove characters from string - at the same position from the last removed

I will start with an example to explain better what I mean. I have the following string:
$str = "x' OR firstname LIKE '%Carla%";
$returned_str = chunk_split($str,1,".");
echo $returned_str;

This string is being returned like this:
x.'. .O.R. .f.i.r.s.t.n.a.m.e. .L.I.K.E. .'.%.C.a.r.l.a.%.

So now what I am trying to do is to reverse what I did with chunk_split().
I want to remove the dots, but only the ones that are precedent of one character, and to do this successfully, the solution shouldn't remove original dots of the string.
So this string:

My name is Fábio. I like PHP. I am Portuguese.

In the end shouldn't end like this:

My name is Fábio I like PHP I am Portuguese

A:

You can use str_split for convert your string to an array.
Then, you recreate your string in concatenating a char on two (modulo 2 for example).
Edit: or just :
$reverse = '';
for ($i=0; $i < strlen($returned_str); $i += 2)
    $reverse .= $returned_str[$i];

