Category: CorePhp

How do I get PHP errors to display?

You can’t catch parse errors when enabling error output at runtime, because it parses the file before actually executing anything (and since it encounters an error during this, it won’t execute anything). You’ll need to change the actual server configuration so that display_errors is on and the approriate error_reporting level is used. If you don’t

How to delete an element from an array PHP

There are different ways to delete an array element, where some are more useful for some specific tasks than others. Delete one array element If you want to delete just one array element you can use [crayon-5e8c1f32e9bf4323967666-i/] or alternative [crayon-5e8c1f32e9c07669766085-i/]. Also if you have the value and don’t know the key to delete the element you can use [crayon-5e8c1f32e9c10905612089-i/] to

How do I get a YouTube video thumbnail from the YouTube API?

Each YouTube video has 4 generated images. They are predictably formatted as follows: [crayon-5e8c1f32eb076878428707/] The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of [crayon-5e8c1f32eb08a195957860-i/], [crayon-5e8c1f32eb093614352279-i/], [crayon-5e8c1f32eb09b640184319-i/]) is: [crayon-5e8c1f32eb0a3932621716/] For the high quality version of the thumbnail use a url similar to this: [crayon-5e8c1f32eb0ab751639918/] There

How can I prevent SQL injection in PHP?

Use prepared statements and parameterized queries. These are SQL statements that are sent to and parsed by the database server separately from any parameters. This way it is impossible for an attacker to inject malicious SQL. You basically have two options to achieve this: Using PDO (for any supported database driver): [crayon-5e8c1f32eb8d6479973943/] Using MySQLi (for MySQL): [crayon-5e8c1f32eb8e5896235706/] If you’re connecting

How to integrate WordPress template with CodeIgniter

First step is to move CodeIgniter and the WordPress files in their own directory. After that, put the following line at the top of your CodeIgniter’s [crayon-5e8c1f32ec60e197338257-i/] file. Change the path to [crayon-5e8c1f32ec61e439549850-i/] as needed to point to your WordPress’s root directory. [crayon-5e8c1f32ec627954012084/] Then, you can use the following functions inside your views: [crayon-5e8c1f32ec630105640793/] Other helper functions can also