Author: admin

  • Files & I/O

    This chapter will explain following functions related to files − Opening and Closing Files The PHP fopen() function is used to open a file. It requires two arguments stating first the file name and then mode in which to operate. Files modes can be specified as one of the six options in this table. Sr.No Mode &…

  • Integers

    Integer is one of the built-in scalar types in PHP. A whole number, without a decimal point in the literal, is of the type “int” in PHP. An integer can be represented in decimal (base 10), hexadecimal (base 16), octal (base 8) or binary (base 2) notation. To use octal notation, a number is preceded…

  • How can you avoid callbacks?

    To avoid callbacks, you can use any one of the following options:

  • Boolean

    In PHP, “bool” is one of the built-in scalar data types. It is used to express the truth value, and it can be either True or False. A Boolean literal uses the PHP constants True or False. These constants are case-insensitive, in the sense, true, TRUE or True are synonymous. You can declare a variable…

  • What is an asynchronous API?

    All the API’s of Node.js library are asynchronous means non-blocking. A Node.js based server never waits for an API to return data. The Node.js server moves to the next API after calling it, and a notification mechanism of Events of Node.js responds to the server for the previous API call.

  • Strings

    A string is a sequence of characters, like ‘PHP supports string operations.’ A string in PHP as an array of bytes and an integer indicating the length of the buffer. In PHP, a character is the same as a byte. This means that PHP only supports a 256-character set, and hence does not offer native…

  • What is error-first callback?

    Error-first callbacks are used to pass errors and data. If something goes wrong, the programmer has to check the first argument because it is always an error argument. Additional arguments are used to pass data.

  • What are buffers in Node.js?

    In general, a buffer is a temporary memory mainly used by the stream to hold on to some data until it is consumed. Buffers are used to represent a fixed-size chunk of memory allocated outside of the V8 JavaScript engine. It can’t be resized. It is like an array of integers, which each represents a…

  • Type Juggling

    PHP is known as a dynamically typed language. The type of a variable in PHP changes dynamically. This feature is called “type juggling” in PHP. In C, C++ and Java, you need to declare the variable and its type before using it in the subsequent code. The variable can take a value that matches with…

  • What are the modules in Node.js? Which are the different modules used in Node.js?

    In Node.js applications, modules are like JavaScript libraries and include a set of functions. To include a module in a Node.js application, we must use the require() function with the parentheses containing the module’s name. Node.js has several modules which are used to provide the basic functionality needed for a web application. Following is a…