f



Get max value of int in php

Hi All,

Is there any way by which I can get the maximum value of an integer in
PHP?
(Something like int.MAX_INT)

Thanks,
Nikhil
0
3/20/2009 2:07:40 PM
comp.lang.php 32646 articles. 0 followers. Post Follow

4 Replies
718 Views

Similar Articles

[PageSpeed] 20

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

nikhil wrote:
> Hi All,
> 
> Is there any way by which I can get the maximum value of an integer in
> PHP?
> (Something like int.MAX_INT)
> 
> Thanks,
> Nikhil
Hello,

as far as I know you could use:

PHP_INT_SIZE

see http://www.php.net/manual/en/reserved.constants.php for more information
also the comments below.

regards,
j.ke�ler
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknDq0YACgkQE++2Zdc7EtdeVwCfXg9UFn9VILxf5rt4fDsUN7WA
TFwAn3hSc8rCgaZwc0wRzEdeTWYtrsTA
=ggGT
-----END PGP SIGNATURE-----
0
mail1382 (206)
3/20/2009 2:42:14 PM
nikhil schreef:
> Hi All,
> 
> Is there any way by which I can get the maximum value of an integer in
> PHP?
> (Something like int.MAX_INT)
> 
> Thanks,
> Nikhil


PHP_INT_MAX is what you're looking for.


-- 
Amygdala
http://amygdala.110mb.com/
0
example (178)
3/20/2009 5:27:28 PM
On Mar 20, 7:07=A0pm, nikhil <nikhilpanpa...@gmail.com> wrote:
> Hi All,
>
> Is there any way by which I can get the maximum value of an integer in
> PHP?
> (Something like int.MAX_INT)
>
> Thanks,
> Nikhil

Hi Nikhil,

  Are you looking for getting maximum value in an Integer array?

Thanks,
Baalu
0
3/21/2009 11:01:07 AM
baalu aanand wrote:
> On Mar 20, 7:07 pm, nikhil <nikhilpanpa...@gmail.com> wrote:
>> Hi All,
>>
>> Is there any way by which I can get the maximum value of an integer
>> in PHP?
>> (Something like int.MAX_INT)
>>
>> Thanks,
>> Nikhil
>
> Hi Nikhil,
>
>   Are you looking for getting maximum value in an Integer array?

Probably not. 


0
rf
3/21/2009 12:00:03 PM
Reply:

Similar Artilces:

PHP Training Institute In Delhi, Live Projects on PHP. Short Term PHP Courses, PHP Scripts, PHP Training with Live Projects.
Vserve Global offers short term PHP: Hypertext Preprocessor Training Course, which is a widely used, general-purpose scripting language that was originally designed for web development, to produce dynamic web pages. It can be embedded into HTML and generally runs on a web server, which needs to be configured to process PHP code and create web page content from it. It can be deployed on most web servers and on almost every operating system and platform free of charge.PHP is installed on over 20 million websites and 1 million web servers. TOPICS:- >> Core PHP Language >> HTML, Cascad...

php outside php (?)
Sounds weird, i know. What i want/wonder is the following: PHP can do the next: <?php if($foo == 'bar') { ?> Ow yeah, foo is bar! <?php }; ?> But how can i do the following: <?php $foo= ?> this is what foo looks like. <?php }; ?> This way i could edit the content of $foo in DW's design-view. I hope it's clear enough for you all to understand... Greetings frizzle. frizzle wrote: > But how can i do the following: > > <?php > > $foo= > > ?> > this is what foo looks like. > <?php > > }; > > ?> > > This way i could edit the content of $foo in DW's design-view. > I hope it's clear enough for you all to understand... <?php ob_start(); ?> this is what foo looks like. <?php $foo=ob_get_clean(); ?> -- Justin Koivisto - justin@koivi.com http://koivi.com Wow, little late on the reply, but i still wanted to thank you for your help. This is exactly what i meant, and it works great! :D Thanks again. ...

php to php obj
Hi All, Is there any tool to convert the .php files into its object files in deploying the files to other's server like java classes are deployed? Thanks in advance --AR John7481 <arjohn7481@hotmail.com> wrote or quoted: > Is there any tool to convert the .php files into its object files in > deploying the files to other's server like java classes are deployed? To what end? Do you want a PHP obfuscator? They tend not to be needed - since the code remains on the server. Do you want a PHP squeezer? Again - since PHP remains on the server that is of reduced importance. PHP obfuscators and squeezers are out there - but what exactly are you looking for? -- __________ |im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply. With total disregard for any kind of safety measures Tim Tyler <tim@tt1lock.org> leapt forth and uttered: > John7481 <arjohn7481@hotmail.com> wrote or quoted: > >> Is there any tool to convert the .php files into its object >> files in deploying the files to other's server like java >> classes are deployed? > > To what end? > > Do you want a PHP obfuscator? They tend not to be needed - > since the code remains on the server. > > Do you want a PHP squeezer? Again - since PHP remains on the > server that is of reduced importance. > > PHP obfuscators and squeezers are out there - but what exactly > are you looking for? I think he'...

PHP within PHP...
I took over the support of a website that is set up something like this inside one of the pages: include_once("header.php"); <?php //to get the content of the page they do this: $content = mysql_query("select content etc...); echo $content; ?> include_once("footer.php"); I am having problems evaluating any php that is used in the mysql content. Is there a way to get the mysql withing the mysql to run? Thank you for your time, Mandragon On Sep 17, 12:56 pm, Mandrago...@gmail.com wrote: > I took over the support of a website that is set up something like > this inside one of the pages: > > include_once("header.php"); > > <?php > //to get the content of the page they do this: > $content = mysql_query("select content etc...); > > echo $content; > ?> > > include_once("footer.php"); > > I am having problems evaluating any php that is used in the mysql > content. Is there a way to get the mysql withing the mysql to run? > > Thank you for your time, > > Mandragon Sorry, The question should read: "Is there a way to get the php withing the echo $htmlcontent to run?" Of course you are, $content is a resource. The MySQL Query resource. try this: $content = mysql_query('bla bla bla'); while ($row = mysql_fetch_assoc($content)) { $result[] = $row; } $content = $result; Now you can use $content ;). In answer to your edit... eval($co...

php.ini sets max time to 90 seconds, yet I get a "Max execution time of 30 seconds exceeded"
This is weird. When I use getId3 to try to read meta tags out of multimedia files, I get this error: Fatal error: Maximum execution time of 30 seconds exceeded in /home/ httpd/vhosts/bluewallmultimedia.com/httpdocs/getid3/getid3/ getid3.lib.php on line 54 But if I run phpinfo(), I get this: max_execution_time 95 95 and if I ssh to the server and look in php.ini, this is confirmed: max_execution_time = 95 ; Maximum execution time of each script, in seconds This is on a RackSpace server, running RedHat. It's got Plesk installed. Can anyone guess what is going on? Is there some...

Getting values into running VRML from PHP
Hi ng, I've tried to find solution to interact with running VRML from PHP. No success :-( I saw here couple of questions about it but no clear answer or some unique solution. Could somebody provide an example? What I want to do? I have a VRML file which IS generated by PHP, and this wrl file shows stats about page visits/visitors... It is OK and when I reload it it will show new status for egg. if there is 4 visitors, it will show 4 lines in front of cube. But I want to have wrl running all the time, and with help of some timer to fetch new status from PHP script and...

want to get content of one php file in another php file
i have one php file having content Contents of ex1.php file <body> <?php $content = "c://webserver/www/abc.php"; $handle = fopen($content, "r"); echo fread($handle,filesize($content)); ?> </body> this is reading abc.php file in which i m simply using an echo statement. When i execute ex1.php file i cant see the php statement of abc.php file content of abc.php file is <?php echo "hello";?> sarika wrote: > i have one php file having content > > Contents of ex1.php file > <body> > <?php > $content = "c://webserver/www/abc.php"; > $handle = fopen($content, "r"); > echo fread($handle,filesize($content)); > ?> > </body> > this is reading abc.php file in which i m simply using an echo > statement. When i execute ex1.php file i cant see the php statement of > abc.php file > > content of abc.php file is > <?php echo "hello";?> That's interesting, I've found out that it's the browser that's hiding <?php ?> tags within .phpx pages. Probably to avoid short tags scripts (on a server that doesn't allow them) from getting leaked by visitors who don't know about this browser trick, until the dev' realizes his error. Not a good thing, IMO; dev's should take care, themselves, and it's still not secure since the hidden string is still in the rendered source. And now we don't know how ...

what is wrong with this script and how do I get the value in a php script
what is wrong with this script and how do I get the value Rij1 and Rij2 and Rij3 and Rij4 and Rij5 and Rij6 in a php script import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.IN) GPIO.setup(18, GPIO.IN) GPIO.setup(21, GPIO.IN) GPIO.setup(22, GPIO.IN) GPIO.setup(23, GPIO.IN) GPIO.setup(24, GPIO.IN) Rij1 = 0 Rij2 = 0 Rij3 = 0 Rij4 = 0 Rij5 = 0 Rij6 = 0 while True: PRij1 = GPIO.input(17) PRij2 = GPIO.input(18) PRij3 = GPIO.input(21) PRij4 = GPIO.input(22) PRij5 = GPIO.input(23) PRij6 = GPIO.input(24) if (PRij1 == False): Rij1 = Rij1...

Best PHP Training | PHP Development Training | PHP Training Institute
Tops Technologies provides php and mysql certification courses in ahmedabad, baroda, surat, Rajkot, Udaipur, Gujarat, india.PHP Training with MySQL is an introductory course in the PHP and MySQL technology. Mysql and php training course, php for beginners, sql training courses, PHP Training courses, php courses, mysql training courses, php mysql course. For More Details :- http://www.tops-int.com ...

Newbie: getting /SELECT ONCHANGE value into PHP var
This is very new to me, scripting languages. I am trying to get the /select id off of a dropdownlist, which really does not drop down and is more like a flat list??, at an onchange event. Then move it into a php var to retrieve different data from db. Not that it matters but I load about 1200 items in to the list and was surprised how fast it is. Could some one give me some direction? // // Handle the data coming back <OPTION VALUE="0">Choose a Group echo "<FORM NAME=author>"; echo "<SELECT NAME=author_pk SIZE=20 COLS=20 ONCHANGE=getPK()>";...

help getting value of cell and passing to PHP file
I have a table that gets generated every 5 minutes containing the drive space on my servers. The table is sortable via an external javascript file by clicking the column headers (using sortable.js found here: http://www.kryogenix.org/code/browser/sorttable/) the first 2 cells of the table are the server name and drive. When the server name in the first cell of any row is clicked on, I want to get the value of the data from that rows table cells and pass them to a PHP file that creates a chart of the data. I'm pretty sure javascript is the way to go, but I haven't figured out the right ...

How to get enum values from MySQL column using PHP?
I'm trying to populate an HTML <select> statement with the enum values from a MySQL column using PHP. Can anyone tell me how to access these enum values using PHP? Thanks, Don Don wrote: > I'm trying to populate an HTML <select> statement with the enum values > from a MySQL column using PHP. Can anyone tell me how to access these > enum values using PHP? > > Thanks, > Don More of a MySQL question, but here you go: SELECT yourEnumColumn+0 FROM yourTable; This requests the value as an integer, so it will result one (and the one you want). SELECT CONCAT('', yourEnumColumn) FROM yourTable; Will off course do the opposite, but you wouldn't need it as the string value is returned by default. Best regards. On Thu, 12 Mar 2009 16:36:43 +0100, Dikkie Dik <dikkie@nospam.org> wrote: >Don wrote: >> I'm trying to populate an HTML <select> statement with the enum values >> from a MySQL column using PHP. Can anyone tell me how to access these >> enum values using PHP? >> >> Thanks, >> Don >More of a MySQL question, but here you go: > >SELECT yourEnumColumn+0 FROM yourTable; > >This requests the value as an integer, so it will result one (and the >one you want). > >SELECT CONCAT('', yourEnumColumn) FROM yourTable; > >Will off course do the opposite, but you wouldn't need it as the string >value is returned by default. > >Bes...

How to get value of an input box into php? is it possible? syntax?
Hello, My goal is to make an input check box that saves an input text to a cookie when checked and destroys the cookie when unchecked. I figured i could use the onclick method of the input box to execute the PHP function setcookie, but how do I get the value from the input text? Testing with the window.alert function, inputtextName.value doesn't work in the PHP: <html> Your name: <input class="selectstyle" type="checkbox" name="savename" onclick='window.alert("savename.value")'><br> <input class="inputstyle2&quo...

How PHP $_POST gets the multiple values from a HTML form?
I am try test a simple HTML form with PHP <form method=POST action="testing.php"> Cat <input type="checkbox" name="pet" value="cat"> Dog <input type="checkbox" name="pet" value="dog"> Pig <input type="checkbox" name="pet" value="pig"> <br> <select name="dates" multiple> <option value="Monday">Monday</option> <option value="Tuesday">Tuesday</option> <option value="Wednesday">Wednesday</op...

How to pass a value in Javascript to a value in php
I have not learned Javascript,just copy & paste & revise <script language="JavaScript"> function confirmDelete{ re = confirm("Delete or not?(yes,cancel)"); if (re == "0"){<?php $re1 = 0;?>}else{ <?php $re1 = 1;?>} <!--the upper line will cause the confirm windows disappearing--!> return 0; } document.writeln(confirmDelete()); </script> <?php echo "\$re1 = $re1"; ?> 1. How to pass the value "re" in Javascript to $re1 in php 2. How to revise to make the confir...

Php constants in php.ini
I am trying to set user_agent = PHP_VERSION in php.ini. In my php.ini the instructions say that you can use constants in the php.ini file. The only constants I can get to work, though, are the error level constants like E_ALL, E_ERROR, E_WARNING, etc., ... Is anyone aware of some sort of trick to getting others to work? (I was thinking it would be nice to have the user agent string used by my Php scripts to use PHP_VERSION in the string.) -- ***************************** Chuck Anderson • Boulder, CO http://www.CycleTourist.com Integrity is obvious. The lack of it is common. *****...

PHP does not parse .PHP files
I have this problem with PHP that someone might be able to help. With CLI, I am able to execute my .php files. For example, if I type "php phpinfo.php" , this works fine on my system. If I put the phpinfo.php file is in /var/www/html and I try to access it through the browser, I get the content of the file and not the execution of the file. Instead of display the info of PHP, I got the text of the file as: <?php phpinfo(); ?> Why? Thanks Phong Ho wrote: >I have this problem with PHP that someone might be able to help. > >With CLI, I am able to execute my ....

Does PHP need the .php extension ?
Hi guys, When I use PHP I give my file the .php extension. I always wondered if it could be an .htm page with a <script> block that the PHP resides in, the same way you would do JavaScript. If you can do it that way are there any benifits to that method ? Take care, Cyrus "Cyrus D." <satan@invalid.org> writes: > Hi guys, > > When I use PHP I give my file the .php extension. I always wondered if it > could be an .htm page with a <script> block that the PHP resides in, the > same way you would do JavaScript. If you can do it that way are the...

php notification through php sdk
Hi there I want to build a e-commerce website similar to wish.com and I have chosen opencast as my framework of choice. Now wish has a feature that when you save a product in wish and if you are logged in with Facebook or gmail all of your friends will get a notification that your friends has saved a item on wish. I want a similar feature on my site Now I know Facebook provide a sdk JavaScript and php and wish might be using something similar but I am using open cart can I open home page or product page in the sdk Thanks On 3/20/2015 7:30 AM, apoorv.kanungo@gmail.com wrote: &g...

about php lang
plz told me that what is the php lang., how does it works and where it used. mani <msb.jod@gmail.com> wrote: > plz told me that what is the php lang., how does it works and where it > used. There is a good explanation at http://lmgtfy.com/?q=php regards Henrik -- The address in the header is only to prevent spam. My real address is: hc3(at)poolhem.se Examples of addresses which go to spammers: root@localhost postmaster@localhost On 16 Jun 2009, mani <msb.jod@gmail.com> wrote: > plz told me that what is the php lang., how does it works and > where it used. Lulz. <http://www.google.com/> -- ~Curtis Anonymous (1984 IOCCC winner): int i;main(){for(;i["]<i;++i){--i;}"];read('-'-'-',i+++"hell\ o, world!\n",'/'/'/'));}read(j,i,p){write(j/p+p,i---j,i/i);} mani schreef: > plz told me that what is the php lang., how does it works and where it > used. http://en.wikipedia.org/wiki/Php Tip: If you want to learn something about a subject totally new to you, try wikipedia for a reasonable intro. Regards, Erwin Moller -- "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." -- C.A.R. Hoare ...

php://memory and php://temp
http://php.net/manual/en/wrappers.php.php per the documentation: php://memory and php://temp are both listed under "Allows Appending" what am I missing / what's the point? They only seem to work with read/write modes such as fopen('php://memory','rw'); closing the handle, or trying to open another handle without closing the first essentially erase the contents... so what's the point of fopen('php://memory','a') ? you'll a) be appending nothing, b) no way to read what you just wrote? sure would be nice if you could $fh = fopen('php://memory', 'w'); fwrite($fh, 'test string'); fclose($fh); $fh = fopen('php://memory', 'r'); $result = fgets($fh,2048); fclose($fh); echo $result; On 10/12/2010 9:44 PM, BKDotCom wrote: > http://php.net/manual/en/wrappers.php.php > per the documentation: php://memory and php://temp are both listed > under "Allows Appending" > > what am I missing / what's the point? > > They only seem to work with read/write modes such as > fopen('php://memory','rw'); > > closing the handle, or trying to open another handle without closing > the first essentially erase the contents... so what's the point of > fopen('php://memory','a') ? > you'll > a) be appending nothing, > b) no way to read what you just wrote? > > sure would be nice if you could > > $fh = ...

PHP with Indian PHP Developers
Dear all, If you want to make a PHP web application, or need to <a href="http:// www.virtueinfo.com/php-developers/hire-php-programmers-developers-india.htm">Hire PHP Developer</a>contact a leading <a href="http://www.virtueinfo.com/ php-developers/php-web-development.htm"> PHP Web Development Compnay</ a> <a href="http://www.virtueinfo.com/php-developers/php-web-programming- php-developers-india.htm">Offshore PHP web development India</a> On Thu, 25 Feb 2010 01:37:02 -0800 (PST), Virtue Info wrote: > Dear all, > > > If you want to make a PHP web application, or need to <a href="http:// > www.example.com/php-developers/hire-php-programmers-developers-india.htm">Hire > PHP Developer</a>contact a leading <a href="http://www.example.com/ > php-developers/php-web-development.htm"> PHP Web Development Compnay</ > a> > > ><a href="http://www.example.com/php-developers/php-web-programming- > php-developers-india.htm">Offshore PHP web development India</a> > Third time's the charm? Not exactly a ringing endorsement of the skills you've got available or your testing method reliablity... -- 12. One of my advisors will be an average five-year-old child. Any flaws in my plan that he is able to spot will be corrected before implementation. --Peter Anspach's list of things to do as an ...

why does $_SERVER['PHP_SELF'] say /test.php/test.php for test.php?
I have a PHP script at 127.0.0.1/test.php. It's contents are as follows: <?php echo $_SERVER['PHP_SELF']; ?> And it's output isn't test.php, as I'd expect, or /test.php, but rather, /test.php/test.php. Why? And how do I fix it? El 06/10/2010 6:53, yawnmoth escribi�/wrote: > I have a PHP script at 127.0.0.1/test.php. It's contents are as > follows: > > <?php > echo $_SERVER['PHP_SELF']; > ?> > > And it's output isn't test.php, as I'd expect, or /test.php, but > rather, /test.php/test.php. Why? And how do I fix it? What output do you get if you change it to this? <?php echo '[' . $_SERVER['PHP_SELF'] . ']'; ?> What do your other $_SERVER values look like? <?php print_r($_SERVER); ?> -- -- http://alvaro.es - �lvaro G. Vicario - Burgos, Spain -- Mi sitio sobre programaci�n web: http://borrame.com -- Mi web de humor satinado: http://www.demogracia.com -- On 06/10/10 09:30, "�lvaro G. Vicario" wrote: > El 06/10/2010 6:53, yawnmoth escribi�/wrote: >> I have a PHP script at 127.0.0.1/test.php. It's contents are as >> follows: >> >> <?php >> echo $_SERVER['PHP_SELF']; >> ?> >> >> And it's output isn't test.php, as I'd expect, or /test.php, but >> rather, /test.php/test.php. Why? And how do I fix it? > > What output do you get if you change it ...

PHP
Hi I bought the PHP templates last winter and was trying to experiment with these web templates. I need the adaob 4.53 for PHP as indicatedf in the PHP manuals. The official site does not have it any more. Does anyone this zip file please ? If so, contact me at spiterijesmond@yahoo.co.uk If you use latest versions, the examples in the tutorials will not work as they should. Thanks Jesmond Jesmond: Some minutes ago I sent the file to your email Francisco jesmond.spiteri@visitmalta.com ha escrito: > Hi > I bought the PHP templates last winter and was trying to experiment > with these web templates. I need the adaob 4.53 for PHP as indicatedf > in the PHP manuals. > The official site does not have it any more. > Does anyone this zip file please ? If so, contact me at > spiterijesmond@yahoo.co.uk > If you use latest versions, the examples in the tutorials will not work > as they should. > > Thanks > Jesmond ...

Web resources about - Get max value of int in php - comp.lang.php

2 Brothers Identified as Brussels Attackers; 3rd Suspect Is Sought
Ibrahim el-Bakraoui blew himself up at the airport, and Khalid el-Bakraoui carried out the suicide attack at the subway, Belgian officials said. ...

The Macworld Recap: A deep dive into what iPhone SE and iPad Pro 9.7-inch really mean
It’s been just 48 hours since Apple revealed iPhone SE, the 9.7-inch iPad Pro and lower pricing for Apple Watch. On face value, the news isn’t ...

FBI is working with Cellebrite to unlock San Bernardino iPhone, reports say
Israeli company Cellebrite has been appointed by the FBI to find an alternative way to unlock the iPhone 5c involved in the San Bernardino shootings, ...

US Government Charges Three Suspected Members of Infamous Syrian Electronic Army
Joseph Cox / Motherboard : US Government Charges Three Suspected Members of Infamous Syrian Electronic Army — On Tuesday, the Department of Justice ...

Emory Students So ‘Terrified’ After Seeing Trump 2016 Chalking They Are Offered ‘Emergency Counseling’ ...
Apparently the word Trump is so terrifying to students at Emory University that the student government association released funds to offer those ...

Yahoo follows DraftKings and Fan Duel in suspending fantasy sports in New York
Yahoo was due to suspend paid fantasy sports contests in New York state on Wednesday, a decision that follows similar moves on Monday by DraftKings ...

Barclays isn't planning to support Android Pay in the UK
If UK bank Barclays hadn't angered mobile customers enough over its delayed rollout of Apple Pay, a new announcement today looks take things ...

Wednesday Morning News: Nick Denton, Topher DiMaggio, Amy Schumer, Nate Robinson
BRUSSELS. Prime suspect still at large despite man’s arrest : “Arrested man in Anderlecht is not Najim Laachraoui,” the Derniere Heure newspaper, ...

Nintendo refutes report that Wii U production is ending
While Nikkei, the Japanese business newspaper, may have a decent record when it comes to predicting and leaking the future plans of the country's ...

Warning: Update to iOS 9.3 right now to fix a serious iPhone security vulnerability
We've already given you so many reasons to update your iPhone or iPad to iOS 9.3 when we showed you all the best new features in Apple's latest ...

Resources last updated: 3/23/2016 5:06:18 PM