-1
I have to access a file by php, this file has a variable at line x I want to take the contents of this variable, step to a condition, if other than expected I replace the value of this variable by php, without having q access the file manually.
Summarizing need to access a.php file from a library via php code, check which value of the variable, if different from the expected value change its value, only 2 values, production and test.
Example
linha 12 $varivel = 'teste'; // arquivo.php
// tenho o código que captura o valor da variavel
$oqueTemLinha12 = 'o que tem la';
if ($variavel != 'teste') {
// alterar para produção, e vice e versa, o problema não é a condição e sim como obter um valor de um arquivo e como troca-lo se preciso
}
You are already able to open the file, at least?
– Felipe Avelar
Yes, I can get the value, I just haven’t been able to replace it yet, I use the file to get the line, I get the content, now just change it. @Felipeavelar
– Dexxtz