0

I have a JavaScript function to fetch data from the backend

async getAllExpensesByUser() {
    let response = await fetch("router.php/getAll");
    return response.json();
}

in router.php how can I get the path "/getAll" so I can retrieve data accordingly?

Reem Obeid
  • 75
  • 1
  • 8

1 Answers1

0

You can use this to get uri

basename($_SERVER['REQUEST_URI']);

for more information visit this link or php documantion

HEMN MOVAFQI
  • 33
  • 2
  • 5