Google News
logo
Symfony - Interview Questions
What is the syntax to check a valid email address?
The following syntax is used to check valid email addresses.
Use Symfony\Component\Validator\Constraints as Assert;

class Student {     
/**   
   * @Assert\Email(   
    * message = "The email '{{ value }}' is not a valid email.",   
     * checkMX = true   
      * )   
*/     
  protected $email;     
}
Advertisement