seconds to days in php

Example 1

function secondsToTime($seconds) {
    $dtF = new \DateTime('@0');
    $dtT = new \DateTime("@$seconds");
    return $dtF->diff($dtT)->format('%a days, %h hours, %i minutes and %s seconds');
}
echo secondsToTime(1640467);
# 18 days, 23 hours, 41 minutes and 7 seconds

Example 2

public function toDateInterval($seconds) {
    return date_create('@' . (($now = time()) + $seconds))->diff(date_create('@' . $now));
}
echo $this->toDateInterval(1640467)->format('%a days %h hours %i minutes'));
18 days 23 hours 41 minutes

Maximum execution time of 300 seconds exceeded in

Xampp Users

  1. Go to xampp\phpMyAdmin\
  2. Open config.inc.php
  3. Search for $cfg['ExecTimeLimit'] = 300;
  4. Set a larger value or change to 0 for unlimited
  5. If not found add $cfg['ExecTimeLimit'] = 900; (or 0 for unlimited)
  6. Save the file and restart the server

Important: setting the execution time limit to unlimited is not recommended.

str_word_count

str_word_count(string,return,char)
ParameterDescription
stringRequired. Specifies the string to check
returnOptional. Specifies the return value of the str_word_count() function.Possible
values:
0 – Default. Returns the number of words found
1 – Returns an array with the words from the string
2 – Returns an array where the key is the position of the word in the string, and value is the actual word
charOptional. Specifies special characters to be considered as words.
<?php

print_r(str_word_count("Hello world!"));

print_r(str_word_count("Hello world!",1));


print_r(str_word_count("Hello world!",2));

print_r(str_word_count("Hello world & good morning!",1));

print_r(str_word_count("Hello world & good morning!",1,"&"));

?>

run code after ajax success

<script>
    var done = 0;
    var ind=1;
    var timer=3000;
    var forreplace='soatechnology.net';
      $('form#seoform').submit(function(e) {
        $('#btn').html('Please Wait');
        var form = new FormData($('#seoform')[0]);
$.ajax({
    type: "POST",
    url: "Action/AddWebsite.php",
    data: form,
    cache: false,
    contentType: false,
    processData: false,
    success:  function(data){
        //alert("---"+data);
        $("html, body").animate({ scrollTop: 100 }, "slow");
        if(data <= 0)
        {
          $("#info").html('Already submitted');
          done = 0;
        }else{
          $("#info").html('Submit successfully');
          done = 1;
        }
      $('#seoBtn').html('<a href="/free-website-submission" class="btn btn-success">NeW Submit</a>');  
    },
    complete: function (data) {
      staticWebsite = $("#staticWebsite").val();
            $("#curlresult").html('');
           if (staticWebsite.trim() == '') {
                return false;
            }
      if(done)   {
      
      myfun();
      
    }
     }
});
           
            e.preventDefault();          
       
      
               });
              
        function myfun(){
            
       var myVar = setInterval(ajaxfun, timer);
         
           function ajaxfun()
           {
               url=pausecontent.pop();
             url=url.replace(forreplace,staticWebsite);
              
               $.ajax({
                //api call
                url:  'Action/Curl.php',
                //api call end
                data: {
                    url: url,
                                  },
                type: 'POST',
                dataType: 'json',
                beforeSend: function() {
                 
                },
                complete: function(data) {
                     $("#curlresult").append('<li class="list-group-item list-group-item-action bg-light">'+ind+" "+url+'</li>  ');
                  //
                     ind ++;
               if(!pausecontent.length)
            {     clearInterval(myVar);
            
               }
               
                    },
                success: function(data) {
               //  console.log(ind);   
               
                },
                error: function(xhr, ajaxOptions, thrownError) {
                  //  alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
                  $("#curlresult").append('<li class="list-group-item list-group-item-action bg-light">'+ind+" "+url+' Error</li>  ');
                }
            });
           }
            
              
                  
              
        }
        </script>

Phone wallpaper mistakes to avoid

Using a typical image as wallpaper

Across mobile phones and devices, the wallpaper may differ in size. Pick the right dimensions for the proper display of your wallpaper.

Adding long or too much text

Having subtle or a fair amount of text is acceptable. But some phone wallpapers are so cramped with text that they overlap the app icons. Even if you’re featuring a motivational quote in your wallpaper, it should have limited text.

Too many focal points, colors, and elements

There are many phone backgrounds on the Web that look entirely jam-packed. A single glance of the same is sure to overwhelm you. Too many focal points, colors, and elements destroy the purpose.

Ignoring the wallpaper size

Mobile wallpapers’ sizes change as per the size of the device itself. Not following the dimensions may cause any part of your wallpaper to cut off. So it becomes essential to consider the size of the device before creating or downloading phone wallpaper.

HOW TO SET WALLPAPER ON IOS PHONE

There are two ways by which you can set wallpaper on your iPhone:

1st:

  • Go to your iPhone’s ‘Settings’ and pick the ‘Wallpaper’ option.
  • Now, pick the option ‘Choose new wallpaper’ where you will have the option to choose wallpaper from already saved designs, both dynamic and still. You can also pick a photo from the Gallery. 
  • Now, pick the ‘Set’ option that will provide you with three options: ‘Set Home Screen,’ Set Lock Screen,’ or both.

2nd:

  • Choose the ‘Photos’ app of your iPhone in order to pick the photo you want to use as wallpaper.
  • Tap on the ‘share icon’ appearing on the lower left of your screen. Now, choose the option ‘Use as Wallpaper.’ 
  • Now pick the option ‘Lock Screen,’ ‘Home Screen,’ or both.
  • If you can’t find a suitable image in your Gallery to be used as wallpaper, browse the Web and download. 

HOW TO SET WALLPAPER ON ANDROID PHONE

  • Press and hold the blank area on your screen (the blank space where no icons/apps are placed). As and when you press the screen, the home screen option appears. 
  • Pick the ‘add wallpaper’ option and select whether you want the wallpaper to appear on the ‘Lock Screen,’ ‘Home Screen,’ or ‘Home & Lock Screen.’
  • You will also have another set of options appearing in front of you for the selection of wallpaper from locations like — Gallery, Wallpapers, Live Wallpapers, or Photos. 
  • If your wallpaper is in the Gallery, pick the option. You can also crop the image to match the size. Once you are satisfied, tap on the ‘Done’ option.

send WhatsApp template message with parameters

{
    "messaging_product": "whatsapp",
    "to": "{{Recipient-Phone-Number}}",
    "type": "template",
    "template": {
        "name": "promote_website",
        "language": {
            "code": "en_US"
        },
        "components": [{
            "type": "body",
             "parameters": [
                {
                    "type": "text",
                    "text": "http://soatg.in"
                }
             ]
        }]
    }
}

Tips Message Template Guidelines for WhatsApp

  • Make your message template name clear. Instead of using a name like “template_014,” use “bus_ticket_details”.
  • Remember that someone outside of your business will be reviewing your message templates. Providing more clarity gives reviewers context around how the message template will be used.
  • All appeals for rejected message templates require a sample. You can appeal a rejected message template through Direct Support.
  • If you need to write a message template to reopen the 24-hour window, we suggest starting with some mention of the previous conversation thread:
    Example: “I’m sorry that I wasn’t able to respond to your concerns yesterday but I’m happy to assist you now. If you’d like to continue this discussion, please reply with ‘yes’.” or “I was able to do some follow-up based on our previous conversation, and I’ve found the answer to your question about our refund policy. If you’d like to continue our conversation, please say ‘yes’.”

WhatsApp Business Platform, Message Template Guidelines

Rejection Reasons

If your message template(s) have been rejected, it may have been for one of the following reasons:

  • Spelling or grammatical errors. Messages with misspellings or grammatical errors may prompt customers to view these message as spam or a hoax.
  • Variable parameters are missing or have mismatched curly braces. The correct format is {{1}}.
  • Variable parameters are not defined. All parameters must have a known purpose, for example, the type of media you plan to send in a media message. Your template will be rejected if we do not know what goes into a specific parameter. We strongly recommend adding a sample with your submission.
  • Variable parameters contain special characters such as a #, $, or %.
  • Variable parameters are not sequential. For example, {{1}}, {{2}}, {{4}}, {{5}} are defined but {{3}} does not exist.
  • Language defined does not match content. For example, Spanish was select but the content is English or the content is a mixture of languages containing both Spanish and English.
  • Submission format for testing your API connection is incorrect. The correct format is:
    • Message template name: test
    • Content: Hello {{1}}
  • The URLs for your links are shortened. Short links obscure the intended link destination.
  • The URL domain in your links does not belong to your business.
  • The message template(s) contains content that violates WhatsApp’s Commerce Policy: When you offer goods or services for sale, we consider all messages and media related to your goods or services, including any descriptions, prices, fees, taxes and/or any required legal disclosures, to constitute transactions. Transactions must comply with the WhatsApp Commerce Policy.
  • The message template(s) contain content that violates WhatsApp’s Business Policy: Do not request sensitive identifiers from users. For example, do not ask people to share full length individual payment card numbers, financial account numbers, National Identification numbers, or other sensitive identifiers. This also includes not requesting documents from users that might contain sensitive identifiers.
  • The content contains potentially abusive or threatening content, such as threatening a customer with legal action or threatening to publicly shame them.

Quality Rating

The quality rating shows how messages from your template have been received by your customers in a rolling window of the past 24 hours. The quality rating is based on how messages have been received by recipients over the past seven days and is weighted by recency.

We show it in three different states:

  • High (green)
  • Medium (yellow)
  • Low (red)

If we do not have enough quality signals from conversations between your business and customers, your quality status may be “unknown” or “unavailable”.

Status

There are different statuses for templates:

  • Pending: This is when a business first submits a template that hasn’t yet been on-boarded and approved.
  • Approved: The template is approved to be sent on our platform.
  • Rejected: The template is rejected to be on-boarded to our platform.

Occasionally, a template may show one of two particular statuses that are related to quality: Flagged and Disabled.

  • Flagged: This is a warned state. When the quality rating reaches a low (red) state, the template is moved to a Flagged status. If the quality rating improves to a high (green) or medium (yellow) state over 7 days, the template returns to an Approved status.
  • Disabled: After a template enters Flagged Status, if the quality rating does not improve within 7 days, the template across all languages will be Disabled. When disabled, a template cannot be edited or used for sending messages.

Notifications

You will receive an email notification if a template status from your WhatsApp business account(s) changes to Flagged or Disabled.