Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Request Environment filtering

Hello Phalcon team <3

  • $id = $request->getPost('id', 'int');
  • OR
  • $id = $request->getQuery('id', 'int');
    • For example send post: 'NewYork'
    • Returns: empty string
    • For example send post: 'AER-#@SDS'
    • Returns: '-'
    • For example send post: '12-213'
    • Returns: '12-213'

Int filtering not removing " - " this symbol...

Who can explain this why?



hi @Soso int or !int filters remove all characters except digits, plus and minus sign and convert to int in !int case. If you want only get digits you have to create your own filter. Check this documentation

Good luck