PHP Display errors & Debug

5.0 01 To turn on error reporting 1. Set in php.ini 2. In php.code Check error logs on apache server Check errors in log file that is configured in etc/apache2/httpd.conf DEBUG Php useful debugging functions gettype($variable) – Get variable type; var_dump($variable) – Dumps information about a variable; get_defined_vars() – Return an array of all defined …

WordPress plugins development

5.0 01 Why we need plugins on wordpress? The plugins are used to extend default WordPress functionality without touching any core files. Changing anything in the WordPress core files is a bad idea because you can break the site. In plus when WordPress is updated, any core modifications will be overwritten and lost. At this …

Enable Debugging in WordPress

5.0 01 Before we start it is indicated to have the debug enabled. To be sure that debug mode is enabled wordpress, go to the wp-config file and add next lines For more information about enabling debug on wordpress, check out the developer docs at wordpress

Limiting upload file size in PHP

5.0 01 Limiting upload file size We can configure upload max file size in php.ini file, but this is a global maximum for all of PHP. If we want to configure max file size in a particular case, we can do that by adding an attribute to HTML form for MAX_FILE_SIZE. PHP will automatically detect …

Google AdWords Manager Defined Spend (MDS)

5.0 01 Manager Defined Spend (MDS) is a way for My Client Center (MCC) account users to better control the budgets of their AdWords accounts. It’s available for advertisers who meet the eligibility requirements and offer a better flexibility and efficiency for your managed accounts. If advertisers decide to move their managed accounts to MDS, …

Apple and Orange hackerrank solutions

5.0 01 Apple and Orange problem Sam’s house has an apple tree and an orange tree that yield an abundance of fruit. In the diagram below, the red region denotes his house, where s is the start point, and t is the endpoint. The apple tree is to the left of his house, and the …

PHP Arrays

5.0 01 An array is a collection of related values (a list of items) such as names of cities Creating an array $numbers = array(); //empty array To create an array use the function array() like: Numeric Arrays Numeric Arrays are arrays that use only numeric keys, called as numeric, indexed or ordered arrays. Associative …

PHP Conditional Statements: if else, switch

5.0 01 If statement Execute the code if the condition is true If…else statement Switch statement Execute different code depending on a condition. The switch statement is similar to a series of IF statements If the value pass to the switch statement matches, the code that follows the case is executed. Example: Be careful! if …