Php Networking Functions

There are many functions in php to convert or look up domain name, IP address,
protocol, and service information.

Domain name/IP address lookups and conversions

  • gethostbynamel()
  • gethostbyname()
  • gethostbyaddr()
  • ip2long()
  • long2ip()
 Sockets


  • fsockopen()
  • pfsockopen()
  • socket_get_status()
  • socket_set_blocking()
  • socket_set_timeout()

    DNS resource records

    • checkdnsrr()
    • getmxrr()
     
Related Posts:
  • Setting a session's time-PHP After a certain time period, it's reasonable to expect that a user's session should automatically log out, which is essentially an expiration period. PHP allows you to specifically set this duration. The best way to d… Read More
  • PHP-Regular Expressions Think of regular expressions as an elaborate system of matching patterns. You first write the pattern, then use one of PHP's built-in functions to apply the pattern to a text string regular expressions are specifically f… Read More
  • Advantages of Using PHP with MySQL Advantages of Using PHP with MySQL   There are several factors that make using PHP and MySQL together a natural choice: PHP and MySQL work well together PHP and MySQL have been developed with each other in … Read More
  • Methods and Constructors-PHP Methods are the functions defined within the class. They work within the environment of the class, including its variables. For classes, there is a special method called a constructor that's called when a new instance … Read More
  • PHP function using PDO for databse function db_connect() { $dsn = "mysql:host=localhost;dbname=test;charset=utf8"; $opt = array( PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_A… Read More
  • PHP-Mathematical Functions ABS(expr)    This function returns the absolute (positive) value of expr. SIGN(expr)    This function returns -1, 0, or 1 depending on whether expr is negative, zero, or positive, re… Read More
  • Showing the Browser and IP Address php Here is a demo page that prints out the browser string and the IP address of the HTTP request. Create a file with the following content in your web directory, name it something like demo.php, and load it in your browser. … Read More
  • How register the variables into a session? session_register ($session_var) function. (adsbygoogle = window.adsbygoogle || []).push({}); … Read More
  • website-secure-PHP Cryptography is the process of changing the format of data (i.e., encrypting it) so that it is more difficult to read. Some cryptography, such as PGP, available for free for public use from http://www.pgp.com,  use… Read More
  • Managing the Database Creating Users To create users above and beyond the default privileged root user, issue the grant command. The grant command uses this syntax: GRANT PRIVILEGES ON DATABASE.OBJECTS TO'USER'@'HOST' IDENTIFIED BY 'PASSWORD… Read More
  • php tutorial-for beginners PHP Functions | PHP Interview Questions,PHP tutorial,seo-tips,seo tutorial,N... PHP Sessions | PHP Interview Questions,PHP tutorial,seo-tips,seo tutorial,Ne... Cookies Ver… Read More
  • PHP-Super global variables Global variables should be used sparingly, since it's easy to accidentally modify a variable by mistake. This kind of error can be very difficult to locate. Additionally, when we discuss functions in detail, you'll lea… Read More
  • Requiring Cookies If the browser doesn’t accept cookies, a session cannot be established because the PHP directive sessions_use_only_cookies has been set to 1 and the alternative (passing the PHPSESSID in the query string of the URL) has been… Read More
  • Create the months table With MySQL Create the months table as follows: CREATE TABLE months ( month_id INT NOT NULL AUTO_INCREMENT, month VARCHAR (20), days INT, PRIMARY KEY (month_id));      To add the months to the new table, s… Read More
  • Improved Array-HandlingPHP PHP  offers a plethora of new functions for accessing and manipulating arrays. These functions include, but are not limited to, array_splice(), array_push(), array_pop(), and array_diff(). Integrated Sessions&n… Read More