Thursday, 30 March 2017

PHP interview Questions

1.  What is PHP?
PHP is a server side scripting language commonly used for web applications. PHP has many frameworks and cms for creating websites.Even a non technical person can cretae sites using its CMS.WordPress,osCommerce are the famus CMS of php.It is also an object oriented programming language like java,C-sharp etc.It is very eazy for learning
2.  What is the use of "echo" in php?
It is used to print a data in the webpage, Example: <?php echo 'Car insurance'; ?> , The following code print the text in the webpage
3.  How to include a file to a php page?
We can include a file using "include() " or "require()" function with file path as its parameter.
4.  What's the difference between include and require?
If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.
5.  require_once(), require(), include().What is difference between them?
require() includes and evaluates a specific file, while require_once() does that only if it has not been included before (on the same page). So, require_once() is recommended to use when you want to include a file where you have a lot of functions for example. This way you make sure you don't include the file more times and you will not get the "function re-declared" error.
6.  Differences between GET and POST methods ?
We can send 1024 bytes using GET method but POST method can transfer large amount of data and POST is the secure method than GET method .
7.  How to declare an array in php?
Eg : var $arr = array('apple', 'grape', 'lemon');
8.  What is the use of 'print' in php?
This is not actually a real function, It is a language construct. So you can use with out parentheses with its argument list.
Example
 print('PHP Interview questions'); 
print 'Job Interview ');
9.  What is use of in_array() function in php ?
in_array used to checks if a value exists in an array
10.             What is use of count() function in php ?
count() is used to count all elements in an array, or something in an object
11.             What's the difference between include and require?
It's how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.
12.             What is the difference between Session and Cookie?
The main difference between sessions and cookies is that sessions are stored on the server, and cookies are stored on the user's computers in the text file format. Cookies can't hold multiple variable while session can hold multiple variables..We can set expiry for a cookie,The session only remains active as long as the browser is open.Users do not have access to the data you stored in Session,Since it is stored in the server.Session is mainly used for login/logout purpose while cookies using for user activity tracking
13.             How to set cookies in PHP?
Setcookie("sample", "ram", time()+3600);
14.             How to Retrieve a Cookie Value?
eg : echo $_COOKIE["user"];
15.             How to create a session? How to set a value in session ? How to Remove data from a session?
Create session : session_start();
Set value into session : $_SESSION['USER_ID']=1;
Remove data from a session : unset($_SESSION['USER_ID'];
16.             what types of loops exist in php?
for,while,do while and foreach (NB: You should learn its usage)
17.             How to create a mysql connection?
mysql_connect(servername,username,password);
18.             How to select a database?
mysql_select_db($db_name);
19.             How to execute an sql query? How to fetch its result ?
$my_qry = mysql_query("SELECT * FROM `users` WHERE `u_id`='1'; "); 
$result = mysql_fetch_array($my_qry);
echo $result['First_name'];
20.             Write a program using while loop
$my_qry = mysql_query("SELECT * FROM `users` WHERE `u_id`='1'; "); 
while($result = mysql_fetch_array($my_qry))
{
echo $result['First_name'.]."<br/>";
}
21.             How we can retrieve the data in the result set of MySQL using PHP?
o   1. mysql_fetch_row
o   2. mysql_fetch_array
o   3. mysql_fetch_object
o   4. mysql_fetch_assoc
22.             What is the use of explode() function ?
Syntax : array explode ( string $delimiter , string $string [, int $limit ] ); 
This function breaks a string into an array. Each of the array elements is a substring of string formed by splitting it on boundaries formed by the string delimiter.
23.             What is the difference between explode() and split() functions?
Split function splits string into array by regular expression. Explode splits a string into array by string.
24.             What is the use of mysql_real_escape_string() function?
It is used to escapes special characters in a string for use in an SQL statement
25.             Write down the code for save an uploaded file in php.
if ($_FILES["file"]["error"] == 0)
{
move_uploaded_file($_FILES["file"]["tmp_name"],
      "upload/" . $_FILES["file"]["name"]);
      echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
 
}
26.             How to create a text file in php?
$filename = "/home/user/guest/newfile.txt";
$file = fopen( $filename, "w" );
if( $file == false )
{
echo ( "Error in opening new file" ); exit();
}
fwrite( $file, "This is a
 simple test\n" );
fclose( $file );
27.             How to strip whitespace (or other characters) from the beginning and end of a string ?
The trim() function removes whitespaces or other predefined characters from both sides of a string.
28.             What is the use of header() function in php ?
The header() function sends a raw HTTP header to a client browser.Remember that this function must be called before sending the actual out put.For example, You do not print any HTML element before using this function.
29.             How to redirect a page in php?
The following code can be used for it, header("Location:index.php");
30.             How stop the execution of a php scrip ?
exit() function is used to stop the execution of a page
31.             How to set a page as a home page in a php based site ?
index.php is the default name of the home page in php based sites
32.             How to find the length of a string?
strlen() function used to find the length of a string
33.             what is the use of rand() in php?
It is used to generate random numbers.If called without the arguments it returns a pseudo-random integer between 0 and getrandmax(). If you want a random number between 6 and 12 (inclusive), for example, use rand(6, 12).This function does not generate cryptographically safe values, and should not be used for cryptographic uses. If you want a cryptographically secure value, consider using openssl_random_pseudo_bytes() instead.
34.             what is the use of isset() in php?
This function is used to determine if a variable is set and is not NULL
35.             What is the difference between mysql_fetch_array() and mysql_fetch_assoc() ?
mysql_fetch_assoc function Fetch a result row as an associative array, While mysql_fetch_array() fetches an associative array, a numeric array, or both
36.             What is mean by an associative array?
Associative arrays are arrays that use string keys is called associative arrays.
37.             What is the importance of "method" attribute in a html form?
"method" attribute determines how to send the form-data into the server.There are two methods, get and post. The default method is get.This sends the form information by appending it on the URL.Information sent from a form with the POST method is invisible to others and has no limits on the amount of information to send.
38.             What is the importance of "action" attribute in a html form?
The action attribute determines where to send the form-data in the form submission.
39.             What is the use of "enctype" attribute in a html form?
The enctype attribute determines how the form-data should be encoded when submitting it to the server. We need to set enctype as "multipart/form-data" when we are using a form for uploading files
40.             How to create an array of a group of items inside an HTML form ?
We can create input fields with same name for "name" attribute with squire bracket at the end of the name of the name attribute, It passes data as an array to PHP. 
For instance :
<input name="MyArray[]" />  <input name="MyArray[]" />  <input name="MyArray[]" />  <input name="MyArray[]" />
41.             Define Object-Oriented Methodology
Object orientation is a software/Web development methodology that is based on the modeling a real world system.An object is the core concept involved in the object orientation. An object is the copy of the real world enity.An object oriented model is a collection of objects and its inter-relationships
42.             How do you define a constant?
Using define() directive, like define ("MYCONSTANT",150)
43.             How send email using php?
To send email using PHP, you use the mail() function.This mail() function accepts 5 parameters as follows (the last 2 are optional). You need webserver, you can't send email from localhost. eg : mail($to,$subject,$message,$headers);
44.             How to find current date and time?
The date() function provides you with a means of retrieving the current date and time, applying the format integer parameters indicated in your script to the timestamp provided or the current local time if no timestamp is given. In simplified terms, passing a time parameter is optional - if you don't, the current timestamp will be used.
45.             Difference between mysql_connect and mysql_pconnect?
There is a good page in the php manual on the subject, in short mysql_pconnect() makes a persistent connection to the database which means a SQL link that do not close when the execution of your script ends. mysql_connect()provides only for the database new connection while using mysql_pconnect , the function would first try to find a (persistent) link that's already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new connection... the connection to the SQL server will not be closed when the execution of the script ends. Instead, the link will remain open for future use.
46.             What is the use of "ksort" in php?
It is used for sort an array by key in reverse order.
47.             What is the difference between $var and $$var?
They are both variables. But $var is a variable with a fixed name. $$var is a variable who's name is stored in $var. For example, if $var contains "message", $$var is the same as $message.
48.             What are the encryption techniques in PHP
MD5 PHP implements the MD5 hash algorithm using the md5 function,
eg : $encrypted_text = md5 ($msg);
mcrypt_encrypt :- string mcrypt_encrypt ( string $cipher , string $key , string $data , string $mode [, string $iv ] ); 
Encrypts plaintext with given parameters
49.             What is the use of the function htmlentities?
htmlentities Convert all applicable characters to HTML entities This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities.
50.             How to delete a file from the system
Unlink() deletes the given file from the file system.
51.             How to get the value of current session id?
session_id() function returns the session id for the current session.
52.             What are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()?
o   Mysql_fetch_array Fetch a result row as an associative array, a numeric array, or both.
o   mysql_fetch_object ( resource result ) Returns an object with properties that correspond to the fetched row and moves the internal data pointer ahead. Returns an object with properties that correspond to the fetched row, or FALSE if there are no more rows
o   mysql_fetch_row() fetches one row of data from the result associated with the specified result identifier. The row is returned as an array. Each result column is stored in an array offset, starting at offset 0.
53.             What are the different types of errors in PHP ?
Here are three basic types of runtime errors in PHP:
o   1. Notices: These are trivial, non-critical errors that PHP encounters while executing a script - for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all - although you can change this default behavior.
o   2. Warnings: These are more serious errors - for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.
o   3. Fatal errors: These are critical errors - for example, instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHP's default behavior is to display them to the user when they take place.
54.             what is sql injection ?
SQL injection is a malicious code injection technique.It exploiting SQL vulnerabilities in Web applications
55.             What is x+ mode in fopen() used for?
Read/Write. Creates a new file. Returns FALSE and an error if file already exists
56.             How to find the position of the first occurrence of a substring in a string
strpos() is used to find the position of the first occurrence of a substring in a string
57.             What is PEAR?
PEAR is a framework and distribution system for reusable PHP components.The project seeks to provide a structured library of code, maintain a system for distributing code and for managing code packages, and promote a standard coding style.PEAR is broken into three classes: PEAR Core Components, PEAR Packages, and PECL Packages. The Core Components include the base classes of PEAR and PEAR_Error, along with database, HTTP, logging, and e-mailing functions. The PEAR Packages include functionality providing for authentication, networking, and file system features, as well as tools for working with XML and HTML templates.
58.             Distinguish between urlencode and urldecode?
This method is best when encode a string to used in a query part of a url. it returns a string in which all non-alphanumeric characters except -_. have replece with a percentege(%) sign . the urldecode->Decodes url to encode string as any %and other symbole are decode by the use of the urldecode() function.
59.             What are the different errors in PHP?
In PHP, there are three types of runtime errors, they are:
Warnings: 
These are important errors. Example: When we try to include () file which is not available. These errors are showed to the user by default but they will not result in ending the script.
 
Notices: 
These errors are non-critical and trivial errors that come across while executing the script in PHP. Example: trying to gain access the variable which is not defined. These errors are not showed to the users by default even if the default behavior is changed.
 
Fatal errors: 
These are critical errors. Example: instantiating an object of a class which does not exist or a non-existent function is called. These errors results in termination of the script immediately and default behavior of PHP is shown to them when they take place. Twelve different error types are used to represent these variations internally.
60. In how many ways you can embed PHP code in an HTML page?
Ans :
(1)<html>
<head><title> <?php    echo  “this is  title”;    ?> </title> </head>
<body>
<?php
echo   “ this is example “;

?>
</body>
</html>

(2)
<html>
<head>
<title>
Second way
<title>
</head>
<body>
<?php  echo ‘<h1>’;
?>
HELLO WORLD

<?php
echo  ‘</h1>’;
?>
</body>
</html>

(3)
 <?php

echo ‘<html>
<head><title> this simple example </title>
</head>
<body>
This is simple example
</body>
</html>’;

?>


Tuesday, 28 March 2017

Math Unicode Entities

Common Arithmetic & Alebgra
 means no HTML entity code exists and that a numeric code must be used.
Character Name
Character
Entity
Num
Entity
Hex 
Entity
LESS THAN
< 
&lt;
&‌#60;
&‌#x3C;
GREATER THAN
> 
&gt;
&‌#62;
&‌#x3E;
LESS THAN OR EQUAL TO
&le;
&‌#8804;
&‌#x2264;
GREATER THAN OR EQUAL TO
&ge;
&‌#8805;
&‌#x2265;
PLUS OR MINUS
±
&plusmn;
&‌#177;
&‌#xB1;
NOT EQUALS
&ne;
&‌#8800;
&‌#x2260;
DIVISION SIGN
÷
&divide;
&‌#247;
&‌#xF7;
TIMES X
×
&times;
&‌#215;
&‌#x00D7;
MINUS
&minus;
&‌#8722;
&‌#x2212;
DIVISION SLASH
&‌#8725;
&‌#x2215;
FRACTION SLASH
&frasl
&‌#8260;
&‌#x2044;
SQUARE ROOT RADICAL
&radic;
&‌#8730;
&‌#x221A;
CUBE ROOT
&‌#8731;
&‌#x221B;
FOURTH ROOT
&‌#8732;
&‌#x221C;
INFINITY
&infin;
&‌#8734;
&‌#x221E;
ALEF INFINITY SYMBOL
&alefsym;
&‌#8501;
&‌#x2135;
FUNCTION ITALIC F
ƒ
&fnof;
&‌#402;
&‌#x192;
PRIME (single quote)
&prime;
&‌#8242;
&‌#x2032;
DOUBLE PRIME (double quote)
&Prime;
&‌#8243;
&‌#x2033;
TRIPLE PRIME (triple quote)
&‌#8244;
&‌#x2034;
THEREFORE (Triangular Dots)
&there4;
&‌#8756;
&‌#x2234;
DOT OPERATOR
&sdot;
&‌#8901;
&‌#x22C5
SUPERSCRIPT TWO
¹
&sup1;
&‌#185;
&‌#xB9;
SUPERSCRIPT TWO
²
&sup2;
&‌#178;
&‌#xB2;
SUPERSCRIPT THREE
³
&sup3;
&‌#179;
&‌#xB3;
LEFT ANGLE BRACKET
&lang;
&‌#9001;
&‌#x2329;
RIGHT ANGLE BRACKET
&rang;
&‌#9002;
&‌#x232A;
LEFT CEILING BRACKET
&lceil;
&‌#8968;
&‌#x2308;
RIGHT CEILING BRACKET
&rceil;
&‌#8969;
&‌#x2309;
LEFT FLOOR BRACKET
&lceil;
&‌#8970;
&‌#x230A;
RIGHT FLOOR BRACKET
&rceil;
&‌#8971;
&‌#x230B;
CIRCLED PLUS (Direct Sum)
&oplus;
&‌#8853;
&‌#x2295;
CIRCLED TIMES (Vector Product)
&otimes;
&‌#8855;
&‌#x2297;
Codes for Common Math Symbols

Superscript and Subscript
HTML
With the Tags
You can use the <sup></sup> tag to create superscript text and <sub></sub> to create su-script text. Or you can use the codes below.
Code: x<sup>x+1</sup>
Result: x
x+1
Code: x<sub>i+1</sub>
Result: x
i+1
With the Codes
Code: x&sup2; 
Result:
 
Code: x&‌#8308; 
Result:
 x
Superscript Chart
Character Name
Character
Num
Entity
Hex 
Entity
SUPERSCRIPT ZERO
&‌#8304;
&‌#x2070;
SUPERSCRIPT ONE
Entity Code =
 &sup1;
¹
&‌#185;
&‌#x00B9;
SUPERSCRIPT TWO 
Entity Code =
 &sup2;
²
&‌#178;
&‌#x00B2;
SUPERSCRIPT THREE 
Entity Code =
 &sup3;
³
&‌#179;
&‌#x00B3;
SUPERSCRIPT FOUR
&‌#8308;
&‌#x2074;
SUPERSCRIPT FIVE
&‌#8309;
&‌#x2075;
SUPERSCRIPT SIX
&‌#8310;
&‌#x2076;
SUPERSCRIPT SEVEN
&‌#8311;
&‌#x2077;
SUPERSCRIPT EIGHT
&‌#8312;
&‌#x2078;
SUPERSCRIPT NINE
&‌#8313;
&‌#x2079;
SUPERSCRIPT PLUS SIGN
&‌#8314;
&‌#x207A;
SUPERSCRIPT MINUS
&‌#8315;
&‌#x207B;
SUPERSCRIPT EQUALS SIGN
&‌#8316;
&‌#x207C;
SUPERSCRIPT LEFT PARENTHESIS
&‌#8317;
&‌#x207D;
SUPERSCRIPT RIGHT PARENTHESIS
&‌#8318;
&‌#x207E;
SUPERSCRIPT LATIN SMALL LETTER I
&‌#8305;
&‌#x2071;
SUPERSCRIPT LATIN SMALL LETTER N
&‌#8319;
&‌#x207F;
Codes for Superscript Characters
Subscript Codes
Character Name
Character
Num
Entity
Hex 
Entity
SUBSCRIPT ZERO
&‌#8320;
&‌#x2080;
SUBSCRIPT ONE
&‌#8321;
&‌#x2081;
SUBSCRIPT TWO
&‌#8322;
&‌#x2082;
SUBSCRIPT THREE
&‌#8323;
&‌#x2083;
SUBSCRIPT FOUR
&‌#8324;
&‌#x2084;
SUBSCRIPT FIVE
&‌#8325;
&‌#x2085;
SUBSCRIPT SIX
&‌#8326;
&‌#x2086;
SUBSCRIPT SEVEN
&‌#8327;
&‌#x2087;
SUBSCRIPT EIGHT
&‌#8328;
&‌#x2088;
SUBSCRIPT NINE
&‌#8329;
&‌#x2089;
SUBSCRIPT PLUS SIGN
&‌#8330;
&‌#x208A;
SUBSCRIPT MINUS
&‌#8331;
&‌#x208B;
SUBSCRIPT EQUALS SIGN
&‌#8332;
&‌#x208C;
SUBSCRIPT LEFT PARENTHESIS
&‌#8333;
&‌#x208D;
SUBSCRIPT RIGHT PARENTHESIS
&‌#8334;
&‌#x208E;
LATIN SUBSCRIPT SMALL LETTER A
&‌#8336;
&‌#x2090;
LATIN SUBSCRIPT SMALL LETTER E
&‌#8337;
&‌#x2091;
LATIN SUBSCRIPT SMALL LETTER O
&‌#8338;
&‌#x2092;
LATIN SUBSCRIPT SMALL LETTER I
&‌#7522;
&‌#x1D62;
LATIN SUBSCRIPT SMALL LETTER R
&‌#7523;
&‌#x1D63;
LATIN SUBSCRIPT SMALL LETTER U
&‌#7524;
&‌#x1D64;
LATIN SUBSCRIPT SMALL LETTER V
&‌#7525;
&‌#x1D65;
LATIN SUBSCRIPT SMALL LETTER X
&‌#8339;
&‌#x2093;
GREEK SUBSCRIPT SMALL LETTER BETA
&‌#7526;
&‌#x1D66;
GREEK SUBSCRIPT SMALL LETTER GAMMA
&‌#7527;
&‌#x1D67;
GREEK SUBSCRIPT SMALL LETTER RHO
&‌#7528;
&‌#x1D68;
GREEK SUBSCRIPT SMALL LETTER PHI
&‌#7529;
&‌#x1D69;
GREEK SUBSCRIPT SMALL LETTER CHI
&‌#7530;
&‌#x1D6A;
Codes for Subscript Characters
Superscript and Subscript
Check these references for other methods to implement superscript/subscript and extra fractions
Fractions
These codes allow fractions to be represented with typographically smaller numerators and denominators, but they can be replaced by other ways of typing a fraction (e.g. "1/2"). CSS Styling can also be used to achieve the same effect as described on Got Unicode and Lars Bruzelius.
Note:
 The code  means no HTML entity code exists and that a numeric code must be used.
Character Name
Character
Entity
Num
Entity
Hex 
Entity
VULGAR FRACTION 1/4
¼
&frac14;
&‌#188;
&‌#xBC;
VULGAR FRACTION 1/2
½
&frac12;
&‌#189;
&‌#xBD;
VULGAR FRACTION 3/4
¾
&frac34;
&‌#190;
&‌#xBE;
VULGAR FRACTION 1/3
&‌#8531;
&‌#x2153;
VULGAR FRACTION 2/3
&‌#8532;
&‌#x2154;
VULGAR FRACTION 1/5
&‌#8533;
&‌#x2155;
VULGAR FRACTION 2/5
&‌#8534;
&‌#x2156;
VULGAR FRACTION 3/5
&‌#8535;
&‌#x2157;
VULGAR FRACTION 4/5
&‌#8536;
&‌#x2158;
VULGAR FRACTION 1/6
&‌#8537;
&‌#x2159;
VULGAR FRACTION 5/6
&‌#8538;
&‌#x215A;
VULGAR FRACTION 1/8
&‌#8539;
&‌#x215B;
VULGAR FRACTION 3/8
&‌#8540;
&‌#x215C;
VULGAR FRACTION 5/8
&‌#8541;
&‌#x215D;
VULGAR FRACTION 7/8
&‌#8542;
&‌#x215E;
Codes for Fracctions

Statistics
 means no HTML entity code exists and that a numeric code must be used.
Character Name
Character
Entity
Num
Entity
Hex 
Entity
LOWER CASE MU (Mean)
μ
&mu;
&‌#956;
&‌#x3BC;
LOWER CASE SIGMA (Standard Deviation)
σ
&sigma;
&‌#963;
&‌#x3C3;
LOWER CASE CHI
χ
&chi;
&‌#967;
&‌#x3C7;
CAPITAL SIGMA N-ARY SUMMATION
&sum;
&‌#8721;
&‌#x2211;
CAPITAL PI N-ARY PRODUCT
&prod;
&‌#8719;
&‌#x220F;
N-ARY COPRODUCT (upside down capital pi)
&‌#8720;
&‌#x2210;
Codes for Statistics Symbols
X-Bar, P-Hat and D-Bar
Some codes like that for  (X-bar) are actually a combination of two codes – the base letter x plus a code for the line above (&‌#772: or   ̄).
Note: These symbols use combining characters and may not appear correctly in some older browsers.
Character Name
Character
HTML Code
X-Bar (Average)
x&‌#772;
P-Hat
p&‌#770;
D-Bar
D&‌#772;
Statistics Symbols using Combining Diacritics

Measurement Symbols
Common Symbols
Character Name
Character
Entity
Num
Entity
Hex 
Entity
DEGREE SYMBOL
°
&deg;
&‌#176;
&‌#xB0;
MICRO MU SYMBOL
µ
&micro;
&‌#181;
&‌#xB5;
SINGLE PRIME (feet, degree minutes)
&prime;
&‌#8242;
&‌#2032;
DOUBLE PRIME (inches, degree minutes)
&Prime;
&‌#8242;
&‌#2032;
PER MILLE (1/1000th)
&permil;
&‌#8240;
&‌#2030;
Codes for Measurement Symbols

Calculus
Common Calculus Entity Codes
Character Name
Character
Entity
Num
Entity
Hex 
Entity
INTEGRAL
&int;
&‌#8747;
&‌#x222B;
PARTIAL DIFFERENTIAL
&part;
&‌#8706;
&‌#2202;
INCREMENT (Difference or capital Delta)
Δ
&Delta;
&‌#8710;
&‌#x2206;
NABLA (Backward Difference, Grad or upside down triangle)
&nabla;
&‌#8711;
&‌#x2207;
Codes for Calculus Symbols
Additional Integral Symbols
These symbols have numeric entity codes only.
Character Name
Character
Num
Entity
Hex 
Entity
DOUBLE INTEGRAL
&‌#8748;
&‌#x222C;
TRIPLE INTEGRAL
&‌#8749;
&‌#x222D;
QUADRUPLE INTEGRAL
&‌#10764;
&‌#x2A0C;
CONTOUR INTEGRAL
&‌#8750;
&‌#x222E;
SURFACE INTEGRAL
&‌#8751;
&‌#x222F;
VOLUME INTEGRAL
&‌#8752;
&‌#x2230;
CLOCKWISE INTEGRAL
&‌#8753;
&‌#x2231;
ANTICLOCKWISE INTEGRAL
&‌#10769;
&‌#x2A11;
CLOCKWISE CONTOUR INTEGRAL
&‌#8754;
&‌#x2232;
ANTICLOCKWISE CONTOUR INTEGRAL
&‌#8755;
&‌#x2233;
Additional Calculus Symbols

Letter Symbols
Character Name
Character
Entity
Num
Entity
Hex 
Entity
INFINITY (Sideways 8)
&infin;
&‌#8734;
&‌#x221E;
ALEF INFINITY SYMBOL
&alefsym;
&‌#8501;
&‌#x2135;
WEIERSTRASS POWER SET (Script Capital P)
&weierp;
&‌#8472;
&‌#x2118;
IMAGINARY Part (Blackletter I)
&image;
&‌#8465;
&‌#x2111;
REAL NUMBER (Blackletter R)
&real;Capital P R I M E
&‌#8476;
&‌#x211C;
DOUBLE-STRUCK REAL NUMBER (Doublestruck R)
&‌#8477;
&‌#x211D;
COMPLEX NUMBERS (Doublestruck C)
&‌#8450;
&‌#x2102;
NATURAL NUMBERS (Doublestruck N)
&‌#8469;
&‌#x2115;
PRIME NUMBERS (Doublestruck P)
&‌#8473;
&‌#x2119;
RATIONAL NUMBERS (Doublestruck Q)
&‌#8474;
&‌#x211A;
INTEGERS (Doublestruck Z)
&‌#8484;
&‌#x2124;
Common Letter Symbols

Logic & Set Theory
 means no HTML entity code exists and that a numeric code must be used.
Character Name
Character
Entity
Num
Entity
Hex
Entity
FOR ALL (Upside-down A)
&forall; 
&‌#8704;
&‌#x2200;
COMPLEMENT (Thin C)
&‌#8705;
&‌#x2201;
THERE EXISTS (Backwards E)
&exist; 
&‌#8707;
&‌#x2203;
THERE DOES NOT EXIST (Backwards E with slash)
&‌#8708;
&‌#x2204;
EMPTY SET (O slash)
&empty; 
&‌#8709;
&‌#x2205;
NOT SYMBOL (Corner)
¬
&not; 
&‌#172;
&‌#xAC;
TILDE (Alternate Not Symbol)
˜
&tilde; 
LOGICAL AND (Wedge or Upside down V Symbol)
&and; 
&‌#8743;
&‌#x2227;
LOGICAL OR (V Symbol)
&or; 
&‌#8744;
&‌#x2228;
XOR
&‌#8891;
&‌#x22BB;
NAND
&‌#8892;
&‌#x22BC;
NOR
&‌#8893;
&‌#x22BD;
INTERSECTION (Cap or Upside Down U)
&cap; 
&‌#8745;
&‌#x2229;
UNION (Cup or U Symbol)
&cup; 
&‌#8746;
&‌#x222A;
ELEMENT OF
&isin; 
&‌#8712;
&‌#x2208;
NOT AN ELEMENT OF
&notin; 
&‌#8713;
&‌#x2209;
SMALL ELEMENT OF
&‌#8714;
&‌#x220A;
CONTAINS AS MEMBER
&ni; 
&‌#8715;
&‌#x220B;
DOES NOT CONTAIN AS MEMBER
&‌#8716;
&‌#x220C;
SMALL CONTAINS AS MEMBER
&‌#8717;
&‌#x220D;
SET MINUS
&‌#8726;
&‌#x2216;
SUBSET OF (Sideways U with cap to left)
&sub; 
&‌#8834;
&‌#x2282;
SUPERSET OF (Sideways U with cap to right)
&sup; 
&‌#8835;
&‌#x2283;
NOT A SUBSET OF (Subset with Slash)
&nsub; 
&‌#8836;
&‌#x2284;
NOT A SUPERSET OF (Superset with slash)
&‌#8837;
&‌#x2285;
SUBSET OF OR EQUAL TO (Subset with line below)
&sube; 
&‌#8838;
&‌#x2286;
SUPERSET OF OR EQUAL TO (Superset with line below)
&supe; 
&‌#8839;
&‌#x2287;
NEITHER A SUBSET OF NOR EQUAL TO
&‌#8840;
&‌#x2288;
NEITHER A SUPERSET OF NOR EQUAL TO
&‌#8841;
&‌#x2289;
SUBSET OF WITH NOT EQUAL TO
&‌#8842;
&‌#x228A;
SUPERSET OF WITH NOT EQUAL TO
&‌#8843;
&‌#x228B;
DIAMOND OPERATOR 
(Possibility)
&‌#8900;
&‌#x22C4;
ASYMPTOTICALLY EQUAL TO
One to one Correspondence
&‌#8771;
&‌#x2243;
NOT ASYMPTOTICALLY EQUAL TO
&‌#8772;
&‌#x2244;
MULTISET (U with arrow)
&‌#8844;
&‌#x228C;
MULTISET MULTIPLICATION (U with dot in center)
&‌#8845;
&‌#x228D;
MULTISET UNION (U with plus in center)
&‌#8846;
&‌#x228E;
DOUBLE SUBSET
&‌#8912;
&‌#x22D0;
DOUBLE SUPERSET
&‌#8913;
&‌#x22D1;
DOUBLE INTERSECTION
&‌#8914;
&‌#x22D2;
DOUBLE UNION
&‌#8915;
&‌#x22D3;
N-ARY LOGICAL AND
&‌#8896;
&‌#x22C0;
N-ARY LOGICAL OR
&‌#8897;
&‌#x22C1;
N-ARY INTERSECTION/td>
&‌#8898;
&‌#x22C2;
N-ARY UNION
&‌#8899;
&‌#x22C3;
CURLY LOGICAL OR
&‌#8910;
&‌#x22CE;
CURLY LOGICAL AND
&‌#8911;
&‌#x22CF;
CIRCLED PLUS (Direct Sum)
&oplus;
&‌#8853;
&‌#x2295;
CIRCLED TIMES (Vector Product)
&otimes;
&‌#8855;
&‌#x2297;
CIRCLED MINUS
&‌#8854;
&‌#x2296;
CIRCLED DIVISION SLASH
&‌#8856;
&‌#x2298;
Codes for Logic and Set Theory Symbols
Other Element Of Symbols
Character Name
Character
Num
Entity
Hex
Entity
ELEMENT OF WITH LONG HORIZONTAL STROKE
&‌#8946;
&‌#x22F2;
ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
&‌#8947;
&‌#x22F3;
SMALL ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
&‌#8948;
&‌#x22F4;
ELEMENT OF WITH DOT ABOVE
&‌#8949;
&‌#x22F5;
ELEMENT OF WITH OVERBAR
&‌#8950;
&‌#x22F6;
SMALL ELEMENT OF WITH OVERBAR
&‌#8951;
&‌#x22F7;
ELEMENT OF WITH UNDERBAR
&‌#8952;
&‌#x22F8;
ELEMENT OF WITH TWO HORIZONTAL STROKES
&‌#8953;
&‌#x22F9;
CONTAINS WITH LONG HORIZONTAL STROKE
&‌#8954;
&‌#x22FA;
CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
&‌#8955;
&‌#x22FB;
SMALL CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
&‌#8956;
&‌#x22FC;
CONTAINS WITH OVERBAR
&‌#8957;
&‌#x22FD;
SMALL CONTAINS WITH OVERBAR
&‌#8958;
&‌#x22FE;
NOTATION BAG MEMBERSHIP
&‌#8959;
&‌#x22FF;
Variants of Element of Symbols

Geometric Symbols
Note: The entity code for the Angle Symbol () is &ang; and the code for the perpendicular angle () is &perp;.
Otherwise, these symbols have numeric codes only.
Angles and Lines
Character Name
Character
Num
Entity
Hex 
Entity
RIGHT ANGLE
&‌#8735;
&‌#x221F;
ANGLE 
Entity Code =
 &ang;
&‌#8736;
&‌#x2220;
MEASURED ANGLE
&‌#8737;
&‌#x2221;
SPHERICAL ANGLE
&‌#8738;
&‌#x2222;
DIVIDES
&‌#8739;
&‌#x2223;
DOES NOT DIVIDE
&‌#8740;
&‌#x2224;
PARALLEL TO
&‌#8741;
&‌#x2225;
NOT PARALLEL TO
&‌#8742;
&‌#x2226;
RIGHT ANGLE WITH ARC
&‌#8894;
&‌#x22BE;
RIGHT TRIANGLE
&‌#8895;
&‌#x22BF;
UP TACK (Perpendicular) 
Entity Code =
 &perp;
&‌#8869;
&‌#x22A5;
RIGHT TACK
&‌#8866;
&‌#x22A2;
LEFT TACK
&‌#8867;
&‌#x22A3;
DOWN TACK
&‌#8868;
&‌#x22A4;
Codes for Angle/Line Symbols
Logical Proofs
Note: The entity code for the Therefore Symbol () is &there4;. Otherwise, these symbols have numeric codes only.
Character Name
Character
Num
Entity
Hex 
Entity
THEREFORE (Triangular Dots)
Entity Code =
 &there4;
&‌#8756;
&‌#x2234;
BECAUSE (Upside down Triangular Dots)
&‌#8757;
&‌#x2235;
PROPORTIONAL TO
Entity Code =
 &prop;
&‌#8733;
&‌#x221D;
END OF PROOF (solid rectangle)
&‌#8718;
&‌#x220E;
Codes for Symbols in Proofs

Equivalence and Proportion Operators
Common Equivalence Operators
Character Name
Character
Entity
Num
Entity
Hex 
Entity
NOT EQUALS
&ne;
&‌#8800;
&‌#x2260;
APPROXIMATELY EQUAL
&cong;
&‌#8773;
&‌#x2245;
ALMOST EQUAL (ASYMPTOTIC)
&asymp;
&‌#8776;
&‌#x2248;
NOT ALMOST EQUAL TO
&‌#8777;
&‌#x2249;
TILDE SIMILAR TO
&sim;
&‌#8764;
&‌#x223C;
IDENTICAL TO (three lines)
&equiv;
&‌#8801;
&‌#x2261;
NOT IDENTICAL TO
&‌#8802;
&‌#x2262;
Codes for Equivalence Statements (e.g. Not Equals)
Other Equivalence Symbols
Character Name
Character
Num
Entity
Hex 
Entity
STRICTLY EQUIVALENT TO
&‌#8803;
&‌#x2263;
NOT IDENTICAL TO
&‌#8802;
&‌#x2262;
LESS-THAN OVER EQUAL TO
&‌#8806;
&‌#x2266;
GREATER-THAN OVER EQUAL TO
&‌#8807;
&‌#x2267;
LESS-THAN BUT NOT EQUAL TO
&‌#8808;
&‌#x2268;
GREATER-THAN BUT NOT EQUAL TO
&‌#8809;
&‌#x2269;
MUCH LESS-THAN
&‌#8810;
&‌#x226A;
MUCH GREATER-THAN
&‌#8811;
&‌#x226B;
BETWEEN
&‌#8812;
&‌#x226C;
NOT EQUIVALENT TO
&‌#8813;
&‌#x226D;
NOT LESS-THAN
&‌#8814;
&‌#x226E;
NOT GREATER-THAN
&‌#8815;
&‌#x226F;
NEITHER LESS-THAN NOR EQUAL TO
&‌#8816;
&‌#x2270;
NEITHER GREATER-THAN NOR EQUAL TO
&‌#8817;
&‌#x2271;
LESS-THAN OR EQUIVALENT TO
&‌#8818;
&‌#x2272;
GREATER-THAN OR EQUIVALENT TO
&‌#8819;
&‌#x2273;
NEITHER LESS-THAN NOR EQUIVALENT TO
&‌#8820;
&‌#x2274;
NEITHER GREATER-THAN NOR EQUIVALENT TO
&‌#8821;
&‌#x2275;
LESS-THAN OR GREATER-THAN
&‌#8822;
&‌#x2276;
GREATER-THAN OR LESS-THAN
&‌#8823;
&‌#x2277;
NEITHER LESS-THAN NOR GREATER-THAN
&‌#8824;
&‌#x2278;
NEITHER GREATER-THAN NOR LESS-THAN
&‌#8825;
&‌#x2279;
NOT TILDE
&‌#8769;
&‌#x2241;
MINUS TILDE
&‌#8770;
&‌#x2242;
ASYMPTOTICALLY EQUAL TO
&‌#8771;
&‌#x2243;
NOT ASYMPTOTICALLY EQUAL TO
&‌#8772;
&‌#x2244;
APPROXIMATELY BUT NOT ACTUALLY EQUAL TO
&‌#8774;
&‌#x2246;
NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO
&‌#8775;
&‌#x2247;
NOT ALMOST EQUAL TO
&‌#8777;
&‌#x2249;
ALMOST EQUAL OR EQUAL TO
&‌#8778;
&‌#x224A;
TRIPLE TILDE
&‌#8779;
&‌#x224B;
ALL EQUAL TO
&‌#8780;
&‌#x224C;
More Equivalence Symbols

Other Mathematical Symbols
These symbols have numeric codes only.
Character Name
Character
Entity
Hex Entity
MINUS-OR-PLUS SIGN
&‌#8723;
&‌#x2213;
DOT PLUS
&‌#8724;
&‌#x2214;
ASTERISK OPERATOR
&‌#8727;
&‌#x2217;
RING OPERATOR
&‌#8728;
&‌#x2218;
BULLET OPERATOR
&‌#8729;
&‌#x2219;
PROPORTIONAL TO
&‌#8733;
&‌#x221D;
RATIO
&‌#8758;
&‌#x2236;
PROPORTION
&‌#8759;
&‌#x2237;
DOT MINUS
&‌#8760;
&‌#x2238 ;
EXCESS
&‌#8761;
&‌#x2239;
GEOMETRIC PROPORTION
&‌#8762;
&‌#x223A;
HOMOTHETIC
&‌#8763;
&‌#x223B;
TILDE OPERATOR
&‌#8764;
&‌#x223C;
REVERSED TILDE
&‌#8765;
&‌#x223D;
INVERTED LAZY S
&‌#8766;
&‌#x223E;
SINE WAVE
&‌#8767;
&‌#x223F;
WREATH PRODUCT
&‌#8768;
&‌#x2240;
EQUIVALENT TO
&‌#8781;
&‌#x224D;
GEOMETRICALLY EQUIVALENT TO
&‌#8782;
&‌#x224E;
DIFFERENCE BETWEEN
&‌#8783;
&‌#x224F;
APPROACHES THE LIMIT
&‌#8784;
&‌#x2250;
GEOMETRICALLY EQUAL TO
&‌#8785;
&‌#x2251;
APPROXIMATELY EQUAL TO OR THE IMAGE OF
&‌#8786;
&‌#x2252;
IMAGE OF OR APPROXIMATELY EQUAL TO
&‌#8787;
&‌#x2253;
COLON EQUALS
&‌#8788;
&‌#x2254;
EQUALS COLON
&‌#8789;
&‌#x2255;
RING IN EQUAL TO
&‌#8790;
&‌#x2256;
RING EQUAL TO
&‌#8791;
&‌#x2257;
CORRESPONDS TO
&‌#8792;
&‌#x2258;
ESTIMATES
&‌#8793;
&‌#x2259;
EQUIANGULAR TO
&‌#8794;
&‌#x225A;
STAR EQUALS
&‌#8795;
&‌#x225B;
DELTA EQUAL TO
&‌#8796;
&‌#x225C;
EQUAL TO BY DEFINITION
&‌#8797;
&‌#x225D;
MEASURED BY
&‌#8798;
&‌#x225E;
QUESTIONED EQUAL TO
&‌#8799;
&‌#x225F;
PRECEDES
&‌#8826;
&‌#x227A;
SUCCEEDS
&‌#8827;
&‌#x227B;
PRECEDES OR EQUAL TO
&‌#8828;
&‌#x227C;
SUCCEEDS OR EQUAL TO
&‌#8829;
&‌#x227D;
PRECEDES OR EQUIVALENT TO
&‌#8830;
&‌#x227E;
SUCCEEDS OR EQUIVALENT TO
&‌#8831;
&‌#x227F;
DOES NOT PRECEDE
&‌#8832;
&‌#x2280;
DOES NOT SUCCEED
&‌#8833;
&‌#x2281;
SQUARE IMAGE OF
&‌#8847;
&‌#x228F;
SQUARE ORIGINAL OF
&‌#8848;
&‌#x2290;
SQUARE IMAGE OF OR EQUAL TO
&‌#8849;
&‌#x2291;
SQUARE ORIGINAL OF OR EQUAL TO
&‌#8850;
&‌#x2292;
SQUARE CAP
&‌#8851;
&‌#x2293;
SQUARE CUP
&‌#8852;
&‌#x2294;
CIRCLED PLUS
&‌#8853;
&‌#x2295;
CIRCLED MINUS
&‌#8854;
&‌#x2296;
CIRCLED TIMES
&‌#8855;
&‌#x2297;
CIRCLED DIVISION SLASH
&‌#8856;
&‌#x2298;
CIRCLED DOT OPERATOR
&‌#8857;
&‌#x2299;
CIRCLED RING OPERATOR
&‌#8858;
&‌#x229A;
CIRCLED ASTERISK OPERATOR
&‌#8859;
&‌#x229B;
CIRCLED EQUALS
&‌#8860;
&‌#x229C;
CIRCLED DASH
&‌#8861;
&‌#x229D;
SQUARED PLUS
&‌#8862;
&‌#x229E;
SQUARED MINUS
&‌#8863;
&‌#x229F;
SQUARED TIMES
&‌#8864;
&‌#x22A0;
SQUARED DOT OPERATOR
&‌#8874;
&‌#x22AA;
ASSERTION
&‌#8870;
&‌#x22A6;
MODELS
&‌#8871;
&‌#x22A7;
TRUE
&‌#8872;
&‌#x22A8;
FORCES
&‌#8873;
&‌#x22A9;
TRIPLE VERTICAL BAR RIGHT TURNSTILE
&‌#8874;
&‌#x22AA;
DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
&‌#8875;
&‌#x22AB;
DOES NOT PROVE
&‌#8876;
&‌#x22AC;
NOT TRUE
&‌#8877;
&‌#x22AD;
DOES NOT FORCE
&‌#8878;
&‌#x22AE;
NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
&‌#8879;
&‌#x22AF;