Found 1060 Articles for PHP

number_format() function in PHP

Samual Sam
Updated on 26-Dec-2019 07:21:15

321 Views

The number_format() function is used to format a number with grouped thousands.Syntaxnumber_format(num,decimals,decimal_pt,separator)Parametersnum − The number to be formatted.decimals − Specifies how many decimals.decimal_pt − The string to be used for decimal point.separator − Specifies the string to be used for thousands separator.ReturnThe number_format() function returns the formatted number.ExampleThe following is an example − Live DemoOutputThe following is the output −10,000,000ExampleLet us see another example − Live DemoOutputThe following is the output −4,000

nl_langinfo() function in PHP

karthikeya Boyini
Updated on 30-Jul-2019 22:30:23

94 Views

The nl_langinfo() function has contained information about language and locale. Note − This function won’t work on Windows. Syntax nl_langinfo(ele) Parameters ele − Specify what element to return. Should be any of the following elements − Time and Calendar − ABDAY_(1-7) - Abbreviated name of the numbered day of the week DAY_(1-7) - Name of the numbered day of the week (DAY_1 = Sunday) ABMON_(1-12) - Abbreviated name of the numbered month of the year MON_(1-12) - Name of the numbered month of the year AM_STR - String for Ante meridian PM_STR - String for Post ... Read More

explode() function in PHP

Samual Sam
Updated on 24-Jun-2020 13:28:14

326 Views

The explode() function is used to split a string by string.Syntaxexplode(delimiter, str, limit)Parametersdelimiter − The boundary stringstr − String to splitlimit − Specifies the number of array elements to return.The following are possible values −Greater than 0 - Returns an array with a maximum of limit element(s)Less than 0 - Returns an array except for the last -limit elements()0 - Returns an array with one elementReturnThe explode() function returns an array of strings.The following is an example −Example Live DemoThe following is the output −OutputArray (    [0] => This    [1] => is    [2] => demo    [3] => ... Read More

convert_cyr_string() function in PHP

karthikeya Boyini
Updated on 30-Jul-2019 22:30:23

106 Views

The convert_cyr_string() function is used to convert from one Cyrillic character set to another. The supported Cyrillic character-sets are − k - koi8-r w - windows-1251 i - iso8859-5 a - x-cp866 d - x-cp866 m - x-mac-cyrillic Syntax convert_cyr_string(str, from, to) Parameters str − String to format from − The source Cyrillic character set, as a single character. to − The destination Cyrillic character set, as a single character. Return The convert_cyr_string() function returns the converted string. The following is an example − Example Live Demo ... Read More

timezone_name_get() function in PHP

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

55 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

74 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

149 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

47 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

64 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

1K+ 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 )

Advertisements