PHP octdec

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

PHP : octdec() function

Description

The octdec() function is used to convert an octal number to a decimal number.

Version

(PHP 4 and above)

Syntax

octdec(num)

Parameter

Name

Description

Required /
Optional

Type

num

The octal number to convert.

Required

String

Return value

The decimal value of the octal string.

Value Type : Float/integer.

Pictorial Presentation

php-math-octdec()

Example :

  1. echo octdec('26').'
    ';  

  2. echo octdec('172').'
    ';  

  3. echo octdec('3154').'
    ';  

  4. ?>  

Output :

22
122
1644