Method: str::email
Creates an encoded email address, including proper html-tags
Info
Syntax
str::email($email, $text=false, $title=false, $class=false)
Parameters
- $email (string) The email address
- $text (string) Specify a text for the email link. If false the email address will be used
- $title (string) An optional title for the html tag.
- $class (string) An optional class name for the html tag.
Return (string)
Example
echo str::email('mail@bastian-allgeier.de');
// output: <a title="mail@bastian-allgeier.de" class="email" href="mailto:mail@bastian-allgeier.de">mail@bastian-allgeier.de</a>
// unencoded: <a title="mail@bastian-allgeier.de" class="email" href="mailto:mail@bastian-allgeier.de">mail@bastian-allgeier.de</a>
echo str::email('mail@bastian-allgeier.de', 'mail me');
// output: <a title="mail@bastian-allgeier.de" class="email" href="mailto:mail@bastian-allgeier.de">mail me</a>
// unencoded: <a title="mail@bastian-allgeier.de" class="email" href="mailto:mail@bastian-allgeier.de">mail me</a>