php-general Digest 29 Sep 2012 03:39:15 -0000 Issue 7985

Topics (messages 319295 through 319298):

A string question
        319295 by: Chris Payne
        319296 by: Simon J Welsh

output command and php
        319297 by: El Ale...

Re: Round help needed
        319298 by: Jay Blanchard

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Hi there everyone,

I basically have the following code, which grabs the 3 numbers to the right:

$input = "250705023";

$resta = substr($input, -3, 3);

Then I manipulate them a little, but my question is - how, once i've used
them to create different values - can I put them back in the original
string at the same location?

Got me a bit confused.

Chris

--- End Message ---
--- Begin Message ---
On 29/09/2012, at 1:29 AM, Chris Payne <oxygene...@gmail.com> wrote:

> Hi there everyone,
> 
> I basically have the following code, which grabs the 3 numbers to the right:
> 
> $input = "250705023";
> 
> $resta = substr($input, -3, 3);
> 
> Then I manipulate them a little, but my question is - how, once i've used
> them to create different values - can I put them back in the original
> string at the same location?
> 
> Got me a bit confused.
> 
> Chris



One way: $input = substr($input, 0, -3) . $resta;
---
Simon Welsh
Admin of http://simon.geek.nz/


--- End Message ---
--- Begin Message ---
People good afternoon am using a system called the collects gammu sms my
cell with a command "gammu getallsms" sms me when I pick up the following:

gammu getallsms> messages.txt

and I keep it in a text file with the following format:

messages.txt

folder, input code, tray

number: +54025487555
SCMD number: 0000000
no coding
Date: 25/02/2012


hello this is a test message

sms January 1

How could I give a more ordered format command output with php?

My idea is to get him into this mysql table but I can not understand how to
format it to work on it I could lend a hand?.

Greetings to all and thanks!

--- End Message ---
--- Begin Message ---
On 9/27/2012 10:05 PM, Chris Payne wrote:
Hi everyone,

I'm having one of those nights where nothing is working, please help

What I have is this:

$rounded_number = round($test, -3);

Here's the problem i'm having, I need it to increment to the nearest 1000
but it seems to only work if the number is over 500.  For example:


123666  WILL round to 124000 BUT if I put 123085 (As an example) it doesn't
round it, it just stays at 123085 - I know it's probably something totally
ridiculously simple but i'm having a mental block tonight.

Any help would really be appreciated.

Chris
http://www.youtube.com/user/zoolook3264

I just tried it here - http://ideone.com/0icSG and it seems to work fine.

--- End Message ---

Reply via email to