decoct() function in PHP



The decoct() function converts a decimal number to an octal. It Returns an octal string of the specified decimal.

Syntax

decoct(num)

Parameters

  • num − The decimal value to convert.

Return

The decoct() function Returns an octal string of the specified decimal.

Example

 Live Demo

<?php
   echo decoct("70");
?>

Output

106

Let us see another example −

Example

 Live Demo

<?php
   echo decoct("7878787888");
?>

Output

72547141460
Updated on: 2020-06-26T09:49:13+05:30

84 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements