Categories
Uncategorized

Check the number for integer in JavaScript

If you want to check the number to be integer, you can use this function:

isInt = function(field) {
  if (+field != field || field.indexOf(".") != -1) {
    return false;
  } else {
    return true;
  }
}
Categories
Uncategorized

Print and Echo differences in PHP

Very often arises the question, what is the difference between print and echo in PHP? Understanding the difference can help you to use the most applicable construction in each case.