php live search email address after @

user3066938
if (isset($result_array)) {
    foreach ($result_array as $result) {
        // Format Output Strings And Hightlight Matches
        $display_function = preg_replace("/".$search_string."/i", "<b class='highlight'>".$search_string."</b>", $result['email']);
        $display_name = preg_replace("/".$search_string."/i", "<b class='highlight'>".$search_string."</b>", $result['email']);
        //$display_url = 'http://php.net/manual-lookup.php?pattern='.urlencode($result['function']).'&lang=en';

        // Insert Name
        $output = str_replace('nameString', $display_name, $html);

        // Insert Function
        $output = str_replace('functionString', $display_function, $output);

        // Insert URL
        //$output = str_replace('urlString', $display_url, $output);

        // Output
        echo($output);
    }

when i search if input is match with the email in the datase, I ONLY want to check everything before @ in the email address ignore everything after @. how am i able to do that?

i try to put

$result = array_shift(explode('@', $result['email']));

before display_function. it will remove everything after @ in the result. but it still display the wrong result. which the input string matching email part after @

ishwar

Use this code:

$email  = '[email protected]';$user = explode('@', $email);echo $user[0];//prints username

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Search for user by email address?

From Dev

Hibernate Search not indexing email address?

From Dev

php and mysql live search

From Dev

php live search with array

From Dev

Get email address of Microsoft Live account

From Dev

Get email address of Microsoft Live account

From Dev

How to send email to user input email address after click a submit button? In php

From Dev

PHP mail is not sending email to my email address

From Dev

PHP mail is not sending email to my email address

From Dev

Partially hide email address in PHP

From Dev

Is a valid paypal email address or not (PHP)

From Dev

Hide part of email address in php

From Dev

Parse email sent to an address with PHP?

From Dev

Live Search Filter with Checkbox PHP

From Dev

Facebook Search API with email address not working?

From Dev

Solr email address search returns 0 results

From Dev

Removing trailing characters after email address with Regex

From Dev

Partially hiding an email address with PHP regex

From Dev

Extract email address from string - php

From Dev

PHP Send email to multiple address from SQL

From Dev

PHP, Validate if user entered an email domain, NOT address

From Dev

PHP Arrays - Sort by Email Address Domain (alternate)

From Dev

sending an email in php to an address stored in database

From Dev

Parse name from full email address in PHP

From Dev

Checking if email address exists in SQL database with php

From Dev

PHP - Live Search using multiple MySQL tables

From Dev

php mail function from email address shows mail server address

From Dev

After generating a random email address, I want to be able to use that same generated email address again

From Dev

PHP - Search for different variations of email addresses in a string

Related Related

  1. 1

    Search for user by email address?

  2. 2

    Hibernate Search not indexing email address?

  3. 3

    php and mysql live search

  4. 4

    php live search with array

  5. 5

    Get email address of Microsoft Live account

  6. 6

    Get email address of Microsoft Live account

  7. 7

    How to send email to user input email address after click a submit button? In php

  8. 8

    PHP mail is not sending email to my email address

  9. 9

    PHP mail is not sending email to my email address

  10. 10

    Partially hide email address in PHP

  11. 11

    Is a valid paypal email address or not (PHP)

  12. 12

    Hide part of email address in php

  13. 13

    Parse email sent to an address with PHP?

  14. 14

    Live Search Filter with Checkbox PHP

  15. 15

    Facebook Search API with email address not working?

  16. 16

    Solr email address search returns 0 results

  17. 17

    Removing trailing characters after email address with Regex

  18. 18

    Partially hiding an email address with PHP regex

  19. 19

    Extract email address from string - php

  20. 20

    PHP Send email to multiple address from SQL

  21. 21

    PHP, Validate if user entered an email domain, NOT address

  22. 22

    PHP Arrays - Sort by Email Address Domain (alternate)

  23. 23

    sending an email in php to an address stored in database

  24. 24

    Parse name from full email address in PHP

  25. 25

    Checking if email address exists in SQL database with php

  26. 26

    PHP - Live Search using multiple MySQL tables

  27. 27

    php mail function from email address shows mail server address

  28. 28

    After generating a random email address, I want to be able to use that same generated email address again

  29. 29

    PHP - Search for different variations of email addresses in a string

HotTag

Archive