When I create the code:
$urlAtual = "https://www.meusite.com.br/customer/account/create/";
$parteurl = explode('/', $urlAtual);
for($i=0;$i<=6;$i++){
$parteurldesejada = $parteurl[$i] . "<br>";
echo $parteurldesejada;
}
It prints in the browser this:
https:
www.meusite.com.br
customer
account
create
Notice that the [1]
value of the array is not shown. Why?
Source code looks like this:
<!DOCTYPE html>
<html>
<head>
<title>Lucas Carvalho</title>
<meta charset="UTF-8">
</head>
<body>
https:<br><br>www.meusite.com.br<br>customer<br>account<br>create<br><br></body>
</html>