Follow the code below:
<?
$url="url_aqui";
$result = file_get_contents($url);
?>
The variable $result
returns the value exactly this way: document.write('11,90');
I need to get only the value that is between the quotation marks, in the case: 11,90
What condition could you use to do this?
Updated code:
$valor_mensal="url_monthly";
$valor_trimestral="url_quarterly";
$valor_semestral="url_semiannually";
$valor_anual="url_annually";
$b_mensal = file_get_contents($valor_mensal);
$b_trimestral = file_get_contents($valor_trimestral);
$b_semestral = file_get_contents($valor_semestral);
$b_anual = file_get_contents($valor_anual);
$primeiroCaractere_b_mensal = strpos($b_mensal, "'");
$primeiroCaractere_b_trimestral = strpos($b_trimestral, "'");
$primeiroCaractere_b_semestral = strpos($b_semestral, "'");
$primeiroCaractere_b_anual = strpos($b_anual, "'");
$basico_mensal = substr($b_mensal, $primeiroCaractere_b_mensal+1, -3);
$basico_trimestral = substr($b_trimestral, $primeiroCaractere_b_trimestral+1, -3);
$basico_semestral = substr($b_semestral, $primeiroCaractere_b_semestral+1, -3);
$basico_anual = substr($b_anual, $primeiroCaractere_b_anual+1, -3);
The URL is composed like this: