Generate a Number

Posted 11 months ago by CodeFox

What would you say is the best way to do this?

I am taking a number from a variable $job and I want to create a new variable ($newJob) which is $job plus an increment. This may have happened in the past so I need to be able to ensure that I'm always going one number higher.

For example:

$job = 1234. In the first pass I would want to be $newJob = 12341.

In the second then $newJob = 12342 and so on.

Each of these variables is getting stored in the DB.

Any suggestions?

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.