PHP is a server-side scripting language designed for web development, enabling dynamic content and database interaction.

PHP Detect Broken Image

Hey, we can see many website have default images if image is broken, so question is how to detect it using php the image is not found given url or not, in php you can do this by just do simple script using cRUL.

cURL is a library that lets you make HTTP requests in PHP, with the script you can check the http request to access different url.

You can use the below code to use this 

How to use memcache with php simple example

Memcache is very popular open source caching tool use in nowdays, this article is related to how we can use the memcache with PHP, So start

First of all you need to install memcache on your server, you can use this link or other according to your operating system

after installation follow below steps to make it work with php

1) Install php-memcached extension, use following command for linux 

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 54 bytes)

Sometimes we get this php error on long page load or load many files are at once

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 54 bytes)

This is because of memory_limit parameter of php.

If you have sufficient RAM available on server your used you can change this parameter on php.ini

change this - 

memory_limit = 128M

TO

memory_limit = 1024M

check if a string contains a specific word with PHP

n PHP sometimes we need to find the specific word in the string for the programitically use the code, there is a function called "strpos()" will help to do this.

example:

 

$string = 'this is website name is key2goal';

if (strpos($string, 'key2goal') !== false) {
    echo "Found";
}

Please Comment your thoughts and feedback below and add something if you found good in anywhere to help others

Reindex the Array keys

Sometimes we need to slice the array for certain values using program a code and at that time key of array is also unset.

If you faced the same then you can use these options

$reindexed_arr = array_values($arr);

you can also try these function in PHP

How you can get Mailchimp API KEY

By Follow steps below, you can find the api key or create the api key at mailchimp and use it to your website to connected the site with mailchimp to collect the subscribe in fastest way.

  1. Login to Mailchimp account 
  2. On upper right side MY ACCOUNT >> Profile, click on profile link
  3. On Profile Page, under Extra >> API Keys
  4. Create API Key and a New API will generated or you can find your old keys here.

Below steps with images:

2)

How to get your MailChimp LIST ID

Mailchimp is marketing automation platform and is provide email for marketing your product or business whatever you like, today its most trusted service providing all over the globe. It is also provided the some service that connected your website and perform peoples to your website.

Today we are writing this to those who want to find list id in our Mailchimp account, because on login there are many services provided, with this tutorial you can easily find that, so let start in steps.

1) Login to your mailchimp account form the login page.

Subscribe to PHP