0

I get an error when I try to use TWILIO. the error is syntax error unexpected 'use' (t_use) in php twilio.

Shasha
  • 439
  • 8
  • 26
  • It's the same person that asked the question that answered to help others facing the same issue. – Shasha Jun 27 '20 at 23:42

1 Answers1

0

The issue is the placement of the use statement.

//This needs to be at the top of your PHP file, not nested in a conditional eg [IF statements or while loops]: top of your PHP file like as though you are connecting to database.
require __DIR__ . '/twilio-php-master/Twilio/autoload.php';
use Twilio\Rest\Client;
Shasha
  • 439
  • 8
  • 26