The CIA triad (confidentiality, integrity and availability) is one of the core principles of information security. After a brief introduction to the basic of CIA, we will show how to apply this principle in PHP, to create secure and robust web applications. We will present some pratical examples using Zend Framework 2, showing how this framework can simplify the life of developers instead of manage everything from scratch in PHP. This talk has been presented at ZendCon 2014 in Santa Clara (California).