5.1 and 5.10 compare equal in php

ExampleNameResult
$a == $bEqualtrue if $a is equal to $b after type juggling.
$a === $bIdenticaltrue if $a is equal to $b, and they are of the same type.
$a != $bNot equaltrue if $a is not equal to $b after type juggling.
$a <> $bNot equaltrue if $a is not equal to $b after type juggling.
$a !== $bNot identicaltrue if $a is not equal to $b, or they are not of the same type.
$a < $bLess thantrue if $a is strictly less than $b.
$a > $bGreater thantrue if $a is strictly greater than $b.
$a <= $bLess than or equal totrue if $a is less than or equal to $b.
$a >= $bGreater than or equal totrue if $a is greater than or equal to $b.
$a <=> $bSpaceshipAn int less than, equal to, or greater than zero when $a is less than, equal to, or greater than $b, respectively.
<?php
var_dump(0 == "a"); // 0 == 0 -> true
var_dump("1" == "01"); // 1 == 1 -> true
var_dump("10" == "1e1"); // 10 == 10 -> true
var_dump(100 == "1e2"); // 100 == 100 -> true

switch ("a") {
case 0:
    echo "0";
    break;
case "a": // never reached because "a" is already matched with 0
    echo "a";
    break;
}
?>
<?php  
// Integers
echo 1 <=> 1; // 0
echo 1 <=> 2; // -1
echo 2 <=> 1; // 1
 
// Floats
echo 1.5 <=> 1.5; // 0
echo 1.5 <=> 2.5; // -1
echo 2.5 <=> 1.5; // 1
 
// Strings
echo "a" <=> "a"; // 0
echo "a" <=> "b"; // -1
echo "b" <=> "a"; // 1
 
echo "a" <=> "aa"; // -1
echo "zz" <=> "aa"; // 1
 
// Arrays
echo [] <=> []; // 0
echo [1, 2, 3] <=> [1, 2, 3]; // 0
echo [1, 2, 3] <=> []; // 1
echo [1, 2, 3] <=> [1, 2, 1]; // 1
echo [1, 2, 3] <=> [1, 2, 4]; // -1
 
// Objects
$a = (object) ["a" => "b"]; 
$b = (object) ["a" => "b"]; 
echo $a <=> $b; // 0
 
$a = (object) ["a" => "b"]; 
$b = (object) ["a" => "c"]; 
echo $a <=> $b; // -1
 
$a = (object) ["a" => "c"]; 
$b = (object) ["a" => "b"]; 
echo $a <=> $b; // 1
 
// not only values are compared; keys must match
$a = (object) ["a" => "b"]; 
$b = (object) ["b" => "b"]; 
echo $a <=> $b; // 1

?>

Soa Technology

radio button act like button bootstrap 3

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>    
<div class="btn-group" data-toggle="buttons">
      <label class="btn btn-primary">
        <input type="radio" name="options" id="option1"> Option 1
      </label>
      <label class="btn btn-primary">
        <input type="radio" name="options" id="option2"> Option 2
      </label>
      <label class="btn btn-primary">
        <input type="radio" name="options" id="option3"> Option 3
      </label>
</div>

60000 salary breakdown for salary slip

Dear All, Kindly provide me the salary breakup of Rs. 60, 000/- gross, with tax saving components, so that the income tax burden is less or, seperate basket (tax saving) of reimbursment can be added up. Its damn urgent, plz revert back!!!

Hi,
You can make it in foll. way:-
Basic=24000(40% of Gross)
HRA=12000(50% of Basic)
Conv Reimbursement=4000
Mobile reimbursement=3000
PF=2880(12% of basic)
Gratuity=1154.4(4.81% of Basic)
Medical Allow=1250(Tax exemp upto 15000 pa)
Special Allow=8716.
Regards

Email : adityaypi@yahoo.com, Mobile : +91-9555699081

Apple Watch SE (2nd Gen) [GPS 44 mm] Smart Watch w/Midnight Aluminium Case & Midnight Sport Band. Fitness & Sleep Tracker, Crash Detection, Heart Rate Monitor, Retina Display, Water Resistant

इस उत्पाद को सर्वश्रेष्ठ ऑफ़र पर खरीदें

opportunity to work for you and this time we will bring the keywords to the top 10 spot with guaranteed period

There is no wondering that it is possible now cause, I have found out that there are few things need to be done for better performances (Some we Discuss ,in this email). Let me tell you some of them –

  1. Title Tag Optimization
  2. Meta Tag Optimization (Description, keyword and etc)
  3. Heading Tags Optimization
  4. Targeted keywords are not placed into tags
  5. Alt / Image tags Optimization
  6. Google Publisher is missing
  7. Custom 404 Page is missing
  8. The Products are not following Structured markup data
  9. Website Speed Development (Both Mobile and Desktop )
    10.Off –Page SEO work

You can see these are the things that need to be done properly to make the keywords others to get into the top 10 spot in Google Search & your sales Increase.

free smtp server

You can achieve this by using PHP’s mail() function or similar in other technologies but these are not recommended as you can run into some deliverability issue here. Especially when you have a shared web server and the server’s IP might already be on spam blacklists, which will send your emails in the recipient’s spam folder and hence conflicting the deliverability. And therefore, this is not a recommended way to sent transactional emails. You can read about who provides dedicated IP here.

Check out our free SMTP server list and choose which plan is best suited for your needs –

  1. SendinBlue – 9000 Free Emails Every Month Forever
  2. Pepipost – 30,000 Free Emails |  150,000 Emails @ Just $17.5
  3. Pabbly – Unlimited Emails | 100 Subscribers
  4. Elastic Emails – $10 | Unlimited Emails to 10,000 contacts
  5. SendPulse
  6. Mailify
  7. MailJet
  8. Amazon SES
  9. Mandrill
  10. Mailgun
  11. Google SMTP Server
  12. Postmark
  13. Spark Post
  14. SendGrid

php mail function not working on ubuntu server

I want to enable the simple php mail() function on an Ubuntu server.

three steps

sudo apt-get install sendmail
sudo sendmailconfig (answer Yes to everything)
sudo service apache2 restart

How to prevent right click and copy on website

For body and other tag to prevent right click

<body oncontextmenu="return false;">
</body>

Using css prevent selection on website

body {
       user-select: none;
}

Using jQuery

// With jQuery
$(document).on({
    "contextmenu": function(e) {
        console.log("ctx menu button:", e.which); 

        // Stop the context menu
        e.preventDefault();
    },
    "mousedown": function(e) { 
        console.log("normal mouse down:", e.which); 
    },
    "mouseup": function(e) { 
        console.log("normal mouse up:", e.which); 
    }
});

Check internet connection using JavaScript

	<script>
          function doesConnectionExist() {
    var xhr = new XMLHttpRequest();
    var file = "https://www.instadiet.in/image/catalog/456.png";
    var randomNum = Math.round(Math.random() * 10000);
 
    xhr.open('HEAD', file, true);
    xhr.send();
     
    xhr.addEventListener("readystatechange", processRequest, false);
 
    function processRequest(e) {
      if (xhr.readyState == 4) {
        if (xhr.status >= 200 && xhr.status < 304) {
          console.log("connection exists!");
        } else {
          console.log("connection doesn't exist!");
        }
      }
    }
}
          setInterval(function(){ 
          doesConnectionExist();
          var ifConnected = window.navigator.onLine;
if (ifConnected) {
  console.log('Connection available');
} else {
  console.log('Connection not available');
}
           }, 3000);</script>

DOMException: The play() request was interrupted

Did you just stumble upon this unexpected media error in the Chrome DevTools JavaScript Console?

Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause().

or

Uncaught (in promise) DOMException: The play() request was interrupted by a new load request.

You’re in the right place then. Have no fear. I’ll explain what is causing this and how to fix it.

What is causing this

Here’s some JavaScript code below that reproduces the “Uncaught (in promise)” error you’re seeing:

<video id="video" preload="none" src="https://example.com/file.mp4"></video>

<script>
  video.play(); // <-- This is asynchronous!
  video.pause();
</script>

The code above results in this error message in Chrome DevTools:

Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause().

As the video is not loaded due to preload="none", video playback doesn’t necessarily start immediately after video.play() is executed.

Moreover since Chrome 50, a play() call on an a <video> or <audio> element returns a Promise, a function that returns a single result asynchronously. If playback succeeds, the Promise is fulfilled and the playing event is fired at the same time. If playback fails, the Promise is rejected along with an error message explaining the failure.

Now here’s what happening:

  1. video.play() starts loading video content asynchronously.
  2. video.pause() interrupts video loading because it is not ready yet.
  3. video.play() rejects asynchronously loudly.

Since we’re not handling the video play Promise in our code, an error message appears in Chrome DevTools.Note: Calling video.pause() isn’t the only way to interrupt a video. You can entirely reset the video playback state, including the buffer, with video.load() and video.src = ''.

How to fix it

Now that we understand the root cause, let’s see what we can do to fix this.

First, don’t ever assume a media element (video or audio) will play. Look at the Promise returned by the play function to see if it was rejected. It is worth noting that the Promise won’t fulfill until playback has actually started, meaning the code inside the then() will not execute until the media is playing.

<video id="video" preload="none" src="https://example.com/file.mp4"></video>

<script>
  // Show loading animation.
  var playPromise = video.play();

  if (playPromise !== undefined) {
    playPromise.then(_ => {
      // Automatic playback started!
      // Show playing UI.
    })
    .catch(error => {
      // Auto-play was prevented
      // Show paused UI.
    });
  }
</script>

Example: Play & Pause

<video id="video" preload="none" src="https://example.com/file.mp4"></video>
 
<script>
  // Show loading animation.
  var playPromise = video.play();
 
  if (playPromise !== undefined) {
    playPromise.then(_ => {
      // Automatic playback started!
      // Show playing UI.
      // We can now safely pause video...
      video.pause();

    })
    .catch(error => {
      // Auto-play was prevented
      // Show paused UI.
    });
  }
</script>

That’s great for this simple example but what if you use video.play() to be able to play a video later?

I’ll tell you a secret. You don’t have to use video.play(), you can use video.load() and here’s how:

Example: Fetch & Play

<video id="video"></video>
<button id="button"></button>

<script>
  button.addEventListener('click', onButtonClick);

  function onButtonClick() {
    // This will allow us to play video later...
    video.load();
    fetchVideoAndPlay();
  }

  function fetchVideoAndPlay() {
    fetch('https://example.com/file.mp4')
    .then(response => response.blob())
    .then(blob => {
      video.srcObject = blob;
      return video.play();
    })
    .then(_ => {
      // Video playback started ;)
    })
    .catch(e => {
      // Video playback failed ;(
    })
  }
</script>

Warning: Don’t make your onButtonClick function asynchronous with the async keyword. You’ll lose the “user gesture token” required to allow your video to play later.

source:https://developers.google.com/web/updates/2017/06/play-request-was-interrupted

is session limit in browser

According to this site, Firefox’s and Safari’s storage limit is 5MB per domain, Internet Explorer’s limit is 10 MB per domain.

However, according to this site which tests your web browser local storage capabilities, on my machine:

Browser        LocalStorage         SessionStorage
-------        ------------         --------------
Chrome              5M                   5M
Firefox             5M                Unlimited
IE11                5M                   5M

Also, note the handy chart at the bottom of the page.