I have this in my function:
$str = $_SERVER['REQUEST_URI']; // it gets: /cart/invisible/
$bits = explode('/',$str);
$num = $bits[2];
A problem is that it return mi error:
PHP Notice: Undefined offset: 2 in /public_html/wp-content/themes/my-theme/functions.php on line 3.
P. S. I just checked the information from "a possible duplicate" and there is not exist even any similar example.
How can I fix it?