/ in the beginning of a link to get to the root folder doesn't work in php include.
for example "/example/example.php"
What is the solution?
I'm assuming by root folder you mean your web document root, rather than filesystem root.
To that end, you can either
include('example/example.php')
include($_SERVER['DOCUMENT_ROOT'].'/example/example.php')