$mail = new SendGrid\Mail();
I don’t understand the meaning of \ in between SendGrid and Mail() above line.
can anybody tell me what it is and its logic.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That defines the namespace. So the Mail library is in the SendGrid namespace. This is a feature only available in PHP 5.3+.
Basically a namespace is a way to limit a scope within which you can have class names. It allows you to have classes with the same name in many different name spaces without collisions between the class definitions. It’s great for writing libraries because it makes it so your library’s end user is not constrained by your naming conventions.