Found 34549 Articles for Programming

timezone_name_get() function in PHP

Samual Sam
Updated on 24-Dec-2019 10:22:52

20 Views

The timezone_name_get() function returns the name of the timezone.Syntaxtimezone_name_get(obj)Parametersobj − A DateTimeZone object.ReturnThe timezone_name_get() function returns array on success or FALSE on failure.ExampleThe following is an example − Live DemoOutputThe following is the output −Europe/Paris

date_time_set() function in PHP

Samual Sam
Updated on 24-Dec-2019 08:43:08

30 Views

The date_time_set() function sets the time. It returns a DateTime object on success. FALSE on failure.Syntaxdate_time_set(obj, hour, minute, second)Parametersobj − DateTime objecthour − Hour of the time to setminute − Minute of the time to setsecond − Second of the time to setReturnThe date_time_set() function returns a DateTime object on success. FALSE on failure.ExampleThe following is an example − Live DemoOutputThe following is the output −2018-09-05 08:15:00ExampleLet us see another example − Live DemoOutputThe following is the output −2017-08-08 13:24:00

call_user_method() function in PHP

Ankith Reddy
Updated on 30-Jul-2019 22:30:23

100 Views

The call_user_method() function call a user method on an specific object. Note − The function is deprecated now. Syntax call_user_method(method, obj, params) Parameters method − Method name obj − Object that method is being called on. params − Array of parameters Alternative Since the call_user_method() deprecated in PHP 4.1.0, and removed in PHP 7.0, therefore use the following as an alternative solution − call_user_func(array($obj, $method), $params);

JDMonthName() function in PHP

Arjun Thakur
Updated on 24-Jun-2020 12:51:38

26 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

cal_to_jd() function in PHP

Ankith Reddy
Updated on 24-Jun-2020 12:52:18

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

get_object_vars() function in PHP

Samual Sam
Updated on 24-Dec-2019 06:53:17

868 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 )

call_user_method_array() function in PHP

Samual Sam
Updated on 24-Jun-2020 12:49:22

104 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);

uksort() function in PHP

Chandu yadav
Updated on 24-Jun-2020 12:45:49

31 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

prev() function in PHP

Chandu yadav
Updated on 30-Jul-2019 22:30:23

51 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

array_pad() function in PHP

Chandu yadav
Updated on 23-Dec-2019 08:50:44

382 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

Advertisements