There are a lot of problems in what you are doing.
See the first case:
$poligono = array( "-22.8919, -43.1272", "-22.8652, -43.0954" );
|_____valor 1______| |_____valor 2______|
You are clearly creating an array with two elements.
Let's go to the second case:
$poligono = array( $poli );
|_valor 1_|
In the same way, you are clearly creating an array with a single value.
Here's an example of your second case:
$poligono = array( '"-22.8919, -43.1272", "-22.8652, -43.0954"' );
|__________________valor 1_________________|
In this way, you will have the same result as the previous example. One value only, in position zero.
If you want to put values in separate positions, you have to provide them separately:
$valor1 = "-22.8919, -43.1272";
$valor2 = "-22.8652, -43.0954";
$poligono = array( $valor1, $valor2 );
Basically PHP will do what you tell it to do. If he sends a value, he obeys. If you send for two, you also obey.
Regarding this here:
$poli = '"-22.8919, -43.1272", "-22.8652, -43.0954"';
You are creating a value only, enclosed in single quotation marks '
. If you put it in an array, it will remain a single value. It all depends on where you get the value, to see the best way to split, or split.
If you really need to do some gambiarra, a solution is this:
$poli = '"-22.8919, -43.1272", "-22.8652, -43.0954"';
$poli = str_replace( ' ', '', $poli );
$poli = str_replace( '","', '"|"', $poli );
print_r ( $poligono = explode( '|', $poli ) );
And if you do not want the quotation marks in the result:
$poli = '"-22.8919, -43.1272", "-22.8652, -43.0954"';
$poli = str_replace( ' ', '', $poli );
$poli = str_replace( '","', '"|"', $poli );
$poli = str_replace( '"', '', $poli );
print_r ( $poligono = explode( '|', $poli ) );
But do not recommend this solution, if you see this in some real code, it is a bad sign. The correct solution is to get the values separately from the DB, and use separately in the array ().