I fear there is a lot of misunderstanding on your part.
First of all, PHP is a backend language, meaning it runs on the server and not on the client (= the browser). PHP (with the CodeIgniter framework) is actually used to generate HTML page containing CSS and JavaScript. Hence why PHP can't interact directly with the browser.
JavaScript is the programming language of the frontend, which run directly on the client (the browser) and directly interact with the user.
Indeed, the 2 lines of code you said you tried are JavaScript code.
So the question would rather be "how to hide browser location permission popup using JavaScript?"
And here is another misunderstanding : luckily, you simply can't. And that's actually good.
When asking for geolocation, any browser will automatically ask user permission to do so. The only thing you can do is wait, hope they accept, and handle the case when they refuse.
There is this good article from MDN explaining why permission are needed, and how they are implemented.
Websites can already track us enough as it is on the web, thanks goodness they can't just get our exact GPS coordinate without asking our permission.