How add tail slash redirect with .htaccees

If you need to do redirect from urls without tail slash to urls with slash, you can simply add this lines in your .htaccess:

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*[^/])$ http://www.site.ru/$1/ [L,R=301]

How to change recipient email on send event in Contact Form 7 (WordPress)

Hello everyone!

Sometimes you may need to send letter from your form on the your website to another recipient, for example user changed some parameters.

You can change recipient email with this hook:

function wpcf7_param_change_on_send($contact_form) {

    $custom_email = $_POST['some_field'];
    if(!empty($custom_email))
    {
      $mail = $contact_form->prop( 'mail' );
      $mail['recipient'] = $custom_email;
      $contact_form->set_properties(array('mail'=>$mail));
    }
}

add_action("wpcf7_before_send_mail", "wpcf7_param_change_on_send");

How to match all h1-h6 tags in PHP

For matching all H tags in html code you need to do this:

preg_match_all('/<h([1-6]).*[^>]*>(.*)<\/h([1-6])>/',$content,$all_h_tags);

Where $content is a string variable with html tags and $all_h_tags is a variable where all matches are put.


Hello

It is my first blog entry.

In this blog I would write about web technologies and how their use in modern web development.