Select a certain Input value

Asked

Viewed 29 times

0

Guys, I’m finalizing a project, by which the user beeps (barcode reader) an input the barcode of a invoice and need to return only the number of the invoice (9 positions) in another input.

The key position is 44 characters. I need to select from character 25 through 34 to get the note number. Can you help me? hug

  • Friend edits your question as what you already have of code, or inputs with numbers etc.

  • You can give a slightly more specific example?

1 answer

0

You can use the function substr():

$codigo = "01234567890123456789012345678901234567890123";
$nota = substr($codigo, 24, 9);

The first parameter you pass the variable, in the second the initial position (position 0 = 1° character, position 24 = 25° character) and in the third, how many characters from the initial

Browser other questions tagged

You are not signed in. Login or sign up in order to post.