Computer >> Computer tutorials >  >> Programming >> PHP

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

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

Output

106

Let us see another example −

Example

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

Output

72547141460