- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 34494 Articles for Programming
27 Views
The JDMonthName() method returns a month name.Syntaxjdmonthname(julian_day, mode)Parametersjulian_day − A julian day numbermode − Specifies which calendar to convert the Julian Day Count to, and what type of month names is to be returned−0 - Gregorian abbreviated form (Jan, Feb, Mar, etc.)1 - Gregorian (January, February, March, etc.)2 - Julian - abbreviated form (Jan, Feb, Mar, etc.)3 - Julian (January, February, March, etc.)4 - Jewish (Tishri, Heshvan, Kislev, etc.)5 - French Republican (Vendemiaire, Brumaire, Frimaire, etc.)ReturnThe JDMonthName() function returns the month name for the specified Julian Day and calendar.ExampleThe following is an example − Live DemoOutputAug Read More
32 Views
The cal_to_jd() function converts a date to Julian day count. It returns a Julian day number.Syntaxcal_to_jd(calendar, month, day, year)Parameterscalendar − The calendar to convert from. Possible values −CAL_GREGORIANCAL_JULIANCAL_JEWISHCAL_FRENCHmonth − Set the month as a number.day − Set the day as a number.year − Set the year as a number.ReturnThe cal_to_jd() function returns a Julian day number.ExampleThe following is an example − Live DemoOutput2458407
884 Views
The get_object_var() function gets the properties of the given object. It returns an associative array of defined object properties for the specified object.Syntaxget_object_vars(object)Parametersobject − An object instance.ReturnThe get_object_var() function returns an associative array of defined object properties for the specified object. If a property have not been assigned a value, it will be returned with a NULL value.ExampleThe following is an example − Live DemoOutputThe following is the output −Array ( [x] => 9.675 [y] => 8.321 [label] => ) Array ( [x] => 9.675 [y] => 8.321 [label] => point #1 )
105 Views
The call_user_method_array() function call a user method given with an array of parameters.Note − The function is deprecated now.Syntaxcall_user_method_array(method, obj, params)Parametersmethod − Method nameobj − Object that method is being called on.params − Array of parametersAlternativeSince the call_user_method_array() deprecated in PHP 4.1.0, and removed in PHP 7.0, therefore use the following as an alternative solution −call_user_func_array(array($obj, $method), $params);
32 Views
The uksort() function sorts an array by keys using a user-defined function. It returns TRUE on success and FALSE on failure.Syntaxuksort(arr, custom_function)Parametersarr − The specified array.custom_function − The comparison function. It must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.ReturnThe uksort() function returns TRUE on success and FALSE on failure.ExampleThe following is an example − Live DemoOutputKey=a Value=99 Key=b Value=27 Key=c Value=56
53 Views
The prev() function rewinds the internal array pointer. It outputs the previous element in the array. Syntax prev(arr) Parameters arr − The specified array. Required. Return The pos() function returns the value of the previous element in an array. Example The following is an example − Live Demo Output one two one
383 Views
The array_pad() function inserts a specified number of items, with a specified value, to an array. It returns array with new elements. If size is positive then the array is padded on the right, if it's negative then the padding is done on the left.Syntaxarray_pad(arr, size, value)Parametersarr − the arraysize − total elements in the resultant arrayvalue − the value to pad and it should be less than the size of arrReturnThe array_pad() function returns array with new elements. If size is positive then the array is padded on the right, if it's negative then the padding is done on ... Read More
272 Views
The atan2() function returns the tangent inverse of the coordinate in terms of y and x. Here y and x are the values of the y and x coordinates respectively. It is an inbuilt function in C++ STL.The syntax of the atan2() function is given as follows.atan2(dataType var1, dataType var2)As can be seen from the syntax, the function atan2() accepts two parameters var1 and var2 of data type float, double or long double that are y and x point respectively.The value returned by atan2() is in the range of -pi to pi and is the angle between the (x, y) ... Read More
1K+ Views
The acos() function returns the inverse cosine of an angle given in radians. It is an inbuilt function in C++ STL.The syntax of the acos() function is given as follows.acos(var)As can be seen from the syntax, the function acos() accepts a parameter var of data type float, double or long double. The value of this parameter should be between -1 and 1. It returns the inverse cosine of var in the range of -pi to pi.A program that demonstrates acos() in C++ is given as follows.Example Live Demo#include #include using namespace std; int main() { double d = ... Read More
37K+ Views
A stack is an abstract data structure that contains a collection of elements. Stack implements the LIFO mechanism i.e. the element that is pushed at the end is popped out first. Some of the principle operations in the stack are −Push - This adds a data value to the top of the stack.Pop - This removes the data value on top of the stack.Peek - This returns the top data value of the stack.A program that implements a stack using linked list is given as follows.Example#include using namespace std; struct Node { int data; struct Node *next; ... Read More