1
I have the following variable for example:
$teste = 'Uma frase qualquer!';
In Python, for me to get the word back frase
, I would use the notation variavel[inicio:fim]
:
teste = 'Uma frase qualquer!'
print(teste[4:9]) # frase
It is possible to use the same notation in PHP?
With the function replace you get similar effect, but not as elegant as python.
– MarceloBoni
I don’t think so, the kind of data string is implemented differently in PHP and Python.
– Giovanni Nunes