Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

gmp_strval(3) [php man page]

GMP_STRVAL(3)								 1							     GMP_STRVAL(3)

gmp_strval - Convert GMP number to string

SYNOPSIS
string gmp_strval (GMP $gmpnumber, [int $base = 10]) DESCRIPTION
Convert GMP number to string representation in base $base. The default base is 10. PARAMETERS
o $gmpnumber - The GMP number that will be converted to a string. Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number. o $base - The base of the returned number. The default base is 10. Allowed values for the base are from 2 to 62 and -2 to -36. RETURN VALUES
The number, as a string. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.3.2 | | | | | | | The $base was extended from 2 to 36, to 2 to 62 | | | and -2 to -36. | | | | +--------+---------------------------------------------------+ NOTES
Note To use the extended base introduced in PHP 5.3.2, then PHP must be compiled against GMP 4.2.0 or greater. EXAMPLES
Example #1 Converting a GMP number to a string <?php $a = gmp_init("0x41682179fbf5"); printf("Decimal: %s, 36-based: %s", gmp_strval($a), gmp_strval($a,36)); ?> PHP Documentation Group GMP_STRVAL(3)

Check Out this Related Man Page

GMP_INIT(3)								 1							       GMP_INIT(3)

gmp_init - Create GMP number

SYNOPSIS
GMP gmp_init (mixed $number, [int $base]) DESCRIPTION
Creates a GMP number from an integer or string. PARAMETERS
o $number - An integer or a string. The string representation can be decimal, hexadecimal or octal. o $base - The base. The base may vary from 2 to 36. If base is 0 (default value), the actual base is determined from the leading charac- ters: if the first two characters are 0x or 0X, hexadecimal is assumed, otherwise if the first character is "0", octal is assumed, otherwise decimal is assumed. RETURN VALUES
A GMP number resource in PHP 5.5 and earlier, or a GMP object in PHP 5.6 and later. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.3.2 | | | | | | | The $base was extended from 2 to 36, to 2 to 62 | | | and -2 to -36. | | | | +--------+---------------------------------------------------+ NOTES
Note To use the extended base introduced in PHP 5.3.2, then PHP must be compiled against GMP 4.2.0 or greater. EXAMPLES
Example #1 Creating GMP number <?php $a = gmp_init(123456); $b = gmp_init("0xFFFFDEBACDFEDF7200"); ?> NOTES
Note It is not necessary to call this function if you want to use integer or string in place of GMP number in GMP functions, like gmp_add(3). Function arguments are automatically converted to GMP numbers, if such conversion is possible and needed, using the same rules as gmp_init(3). PHP Documentation Group GMP_INIT(3)
Man Page

10 More Discussions You Might Find Interesting

1. HP-UX

GMP multi precision math library

Hello all, I'm having trouble building the GNU Multi Precision (GMP 4.1.3) on the HP Intel Itanium 2 HP-UX 11i I'm hoping someone out there has had some experience building GMP on this platform. After running the ./configure and doing a make I get an error saying: `.rodata` is not a section ... (3 Replies)
Discussion started by: vyl
3 Replies

2. Shell Programming and Scripting

fetch string and insert later

"are you billy_smith ?" replace with "are you billy_smith ? my name is billy_smith" how to fetch the name "billy_smith" and using it later I need sed script to do this, any one can help? Thanks (6 Replies)
Discussion started by: playinmel.com
6 Replies

3. AIX

How big is AIX installed base (i.e. number of deployed systems)?

Hi, Just wondered if anyone knows the approximate size of the AIX installed base, i.e. number of machines running out there. I'm expecting a figure of less than a million. There seems to be a lack of info on the web. Presumably only IBM know for sure! (3 Replies)
Discussion started by: garethr
3 Replies

4. Shell Programming and Scripting

Help with shell scripting

HI guys, I need to check the base.txt file with the base.lck file and get a resulting base file which checks the last number in the base.lck file and starts with the number after the numbers in the base.lck file. Here the base.txt is the list of numbers. The base.lck file is something like a... (8 Replies)
Discussion started by: vishva79
8 Replies

5. Programming

Library linking with GMP

I am trying to set up the gnu multiple precision arithmetic library for some c++ programming I have to do. I am using a system with mac osx 10.6.3 and do NOT have root user access. I'm trying to use gmp 5.0.1. Since I don't have root user access, I had to install to a different directory Thus... (3 Replies)
Discussion started by: bluejayek
3 Replies

6. Web Development

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted

Any clues on how to get rid of this PHP error? PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /website/www/includes/functions_manpages.php on line 58 PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71... (4 Replies)
Discussion started by: Neo
4 Replies

7. Shell Programming and Scripting

Matching 2 items in a string

Little lost here, I am trying to search a line for both values after the $ signs. My ultimate goal is to get percertage. <?php $string = "Something on sale for $4 and orginal price $10"; $strstr =. strstr($string, '$'); $strrchr =. strrchr($string, '$'); echo "$strstr<br>"; echo... (1 Reply)
Discussion started by: mrlayance
1 Replies

8. AIX

Removing object from ODM base

Hello! I did a big mistake and now I have to change the ODM base manually :wall: I had a server of test with 2 VG (rootvg and datavg). I had to test something on it with an other AIX version. So, to be sure to restore it, i did a mksysb before but I had completly forgotten the second vg and... (1 Reply)
Discussion started by: Castelior
1 Replies

9. Programming

How to Get Login time history in PHP?

Hi, Need a perfect user data base solution for my ecommerce website. I want to track whole activity of my end user until the user logout Thanks in Advance (1 Reply)
Discussion started by: AimyThomas
1 Replies

10. Shell Programming and Scripting

[Solved] Decoding a base 64 string

Is it possible to decode a base 64 string in linux or unix. If so, related commands or reference notes would be really helpful. (1 Reply)
Discussion started by: chandu123
1 Replies