Nếu trước đây chúng ta sử dụng Regular Expression để kiểm tra định dạng dữ liệu thì rất phức tạp phải không nào? Mình cũng vậy, trước đây mình toàn đi lên mạng kiếm những hàm người ta viết sẵn về sử dụng mà không hề biết ý nghĩa của nó như thế nào 🙂 Nhưng bây giờ thì khác vì trong PHP có một module hỗ trợ việc này khá tốt đó là PHP Filters.

PHP Filter là gì?

PHP Filters là một extension được tích hợp sẵn vào thư viện của PHP, đây là một thư viện dùng để kiểm tra tính hợp lệ của dữ liệu (validate data), lọc và xóa đi những ký tự trùng khớp (Sanitizing data). Nếu dịch theo đúng cái tên của nó là bộ lọc trong PHP, như vậy tác dụng của nó cũng chính là ý nghiax của nó. Thông thường chúng ta hay sử dụng PHP Filters để kiểm tra định dạng dữ liệu vì nó tương đối đơn giản. Và trong series này chúng ta sẽ tìm hiểu tổng cộng các loại filter sau:

  • Validate filters
  • Sanitize filters
  • Flag filters
  • Callback filter


  1. Howdy! I know this is kind of off topic but I was wondering which blog platform are you using for this website?
    I’m getting sick and tired of WordPress because I’ve had issues with
    hackers and I’m looking at alternatives for another platform.

    I would be great if you could point me in the direction of a good platform.

  2. My brother recommended I may like this website. He used to be entirely right.
    This post actually made my day. You cann’t believe simply how a lot time I had spent for this info!
    Thank you!

  3. Greetings from California! I’m bored at work so I decided to
    check out your website on my iphone during lunch break.

    I love the info you provide here and can’t wait to take a look when I get home.
    I’m shocked at how fast your blog loaded on my cell phone ..
    I’m not even using WIFI, just 3G .. Anyhow, awesome blog!

  4. Existe también el llamado anillo de constricción. Otra marca de tadalafil es Adcirca. Se observó disminución en la presión sanguínea, que es, en general, pequeña y probablemente sin relevancia clínica con algunos antihipertensivos. Factores por los que se producen los problemas de impotencia.

  5. hello there and thank you for your info – I have definitely
    picked up something new from right here. I did however
    expertise a few technical points using this web site, as I experienced
    to reload the website a lot of times previous to I could get it to load properly.
    I had been wondering if your web host is OK? Not that I
    am complaining, but sluggish loading instances
    times will often affect your placement in google and could
    damage your high-quality score if advertising and marketing with Adwords.
    Well I am adding this RSS to my email and can look out
    for much more of your respective exciting content.

    Ensure that you update this again very soon.

  6. I believe this is one of the such a lot important information for me.
    And i am satisfied studying your article. However want to observation on some basic
    things, The site taste is ideal, the articles is really excellent : D.

    Just right task, cheers

  7. Hey I know this is off topic but I was wondering if you knew
    of any widgets I could add to my blog that automatically tweet
    my newest twitter updates. I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like
    this. Please let me know if you run into anything.
    I truly enjoy reading your blog and I look forward to your new updates.

  8. Helpful information. Fortunate me I discovered your website by accident,
    and I’m shocked why this twist of fate did not came about earlier!

    I bookmarked it.

  9. Yesterday, while I was at work, my sister stole my apple ipad and tested to see if it can survive a forty foot drop, just so she
    can be a youtube sensation. My apple ipad is now broken and she has 83 views.
    I know this is completely off topic but I had to share it with someone!

  10. Hello there, just became aware of your blog through
    Google, and found that it’s really informative. I am gonna watch out for brussels.
    I will appreciate if you continue this in future. Lots of people
    will be benefited from your writing. Cheers!

  11. Hey! Do you know if they make any plugins to help with SEO?

    I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good gains.
    If you know of any please share. Kudos!


Please enter your comment!
Please enter your name here