Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End PHP Mail Function

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #151095
    mohamedismail
    Participant

    How can we extract string “abc.com” from a string “mailto:[email protected]?subject=Feedback” using regular expression of PHP?

    #151502
    FahimDaDream
    Participant

    You could check out this link: php_regularExp It shows you how to use regular expressions in PHP, then you just need to figure out the regular expression to use :)

    #151509
    __
    Participant

    Note: this doesn’t have anything to do with the PHP mail function.

    preg_match( 
        '/@([\w\d_-]{2,}\.[\w]{2,})\?/'
       ,'mailto:[email protected]?subject=Feedback'
       ,$matches
    );
    
    print $matches[1];
    /* prints
    
    abc.com
    
    */
    

    However, I don’t think that’s the “whole answer” that you’re looking for. Please explain a bit more about what you are doing.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.