Tuesday, October 20, 2020

If API end point is not working in postman or browser please try the below technical methods

Method 1: Check the postman cache and try in new tab.

Method 2: type CTRL+R enter cmd then type ping domainname.com (without http and www) and enter, check if any response is coming.

Method 3: type CTRL+R enter cmd then type

Method 4: type CTRL+R enter drivers then goto this path(C:\Windows\System32\drivers\etc\hosts) and enter edit the host file & add and save it. below line with IP. ie. destination server domain or IP details.

after that try in postman or browser it will work accordingly.

Example.

100.00.00.100 domain.name.com

Monday, October 19, 2020

How To Switch Between Multiple PHP Versions In Ubuntu

 Switch from higher version to lower version

Step 1: login to the server and convert as you as ROOT User

Step 2: Disabling the PHP 7.2 version

root@ip-100-00-00-000:~# sudo a2dismod php7.2 // no space between php7.2

Module php7.2 disabled.

To activate the new configuration, you need to run:

  service apache2 restart

Step 3: service apache2 restart

Step 4: Enabling the PHP 7.0 version:

root@ip-100-00-00-000:~# sudo a2enmod php7.0

Considering conflict php5 for php7.0:

Enabling module php7.0.

To activate the new configuration, you need to run:

  service apache2 restart

Step 5: service apache2 restart.


For this mysql restart is not required

Just keep in mind if mysql or phpmyadmin is not working just restart the mysql 

MYSQL Restart: sudo service apache2 restart


php.ini file location:

/etc/php/7.0/apache2

Thursday, October 8, 2020

From Array to Comma Separated String Values

public function get_branch_details_post(){

     $abm_id = trim($this->post('abm_id'));     

          $branches = $this->branch_model->get_branches($abm_id);

          $branch_list ='';

          if(is_array($branches) && count($branches)>0){

             $i=0;

            foreach ($branches as $row) { 

                if($row['branch_name']!='')

                $branch_list .= $row['branch_name'].','; 

                $i++;

            }

            echo $final_branches = rtrim($branch_list,',');         

          }  

  }

  Output: Abohar, ADIMALY 

Office official mail sending formats

Hi Abc,
Good Morning

Tried reaching you at your mobile however unable to get through.
Sibi from company name this side, I'm supposed to do testing of below mentioned mobile app in trail mail so could you please share me the fresh link of IOS app and other necessary details to initiate the same. Also, if possible, please schedule a call for walkthrough in the second half too.

@xyz
As discussed, kindly share the mobile app and other required details readily available at the moment .

Wednesday, October 7, 2020

Sunday, October 4, 2020

Thursday, October 1, 2020

From Last Month To Current Month Get or Set Any Date Dynamically In PHP & Get Date Difference(How Many Days)

$date1 = date("Y-m-d", strtotime("first day of last month"));

echo $datestart = date('Y-m-d', strtotime("+4 days", strtotime($date1))); // date start 

$date2 = date("Y-m-d", strtotime("first day of this month"));

echo $dateend = date('Y-m-d', strtotime("+4 days", strtotime($date2))); // date end

Output:

2020-09-05

2020-10-05

**************************************************************************************

$from_date = date("Y-m-d", strtotime('2020-09-05'));

$today_date = date('2020-10-01'); //date('Y-m-d');

$date1 = new DateTime($from_date);

$date2 = new DateTime($today_date);

$diff = $date1->diff($date2);

echo $diff->days;

Output: 26

**************************************************************************************

Write PHP code and execute PHP script with online editor

Click here http://www.writephponline.com