please do my homework for me[was] Re: [PHP] string to integer conversion
| From: | Jochem Maas | Date: | Wed, 15 Mar 2006 12:37:03 +0000 |
| Subject: | please do my homework for me[was] Re: [PHP] string to integer conversion | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-231933@lists.php.net to get a copy of this message | ||
suresh kumar wrote:
i am facing one problem in type casting. $accno="00002927"; $accno=$accno+1; its o/p is 2928. but i want output to be 00002928.i ammy h/t is g/d but if d/l is w/h then I w/s but only if it's g/v
waiting response from u.from what I gather your always waiting for a response. here is a not so subtle hint: READ THE F***ING MANUAL AND SEARCH THE F***ING WEB. seeing as you know both the terms 'PHP' and 'type casting' you might consider starting off by using those as search terms - search terms are generally entered into what we like to call a search engine. here is a link to one just in case the concept is completely alien to you: http://yahoo.com/ and if your feeling really adventurous why not try writing a few lines of code to investigate the problem. e.g. php -r '$a = "000281";var_dump(($a + 1), ($a . 1), ($a . strval(1)));' OUTPUTS: int(282) string(7) "0002811" string(7) "0002811"
__________________________________________________________ Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com