In input form can I use just the last 10 characters when I submit a form?
For example, this link: http://linkwebiste.com/test?x=123456789012
woulc be the value on an input
box (like search) and I’ll submit, but I just require 123456789012
.
I want the results of input form to be in another page, like <form action="page2.php" method="post">
There are 2 images for example (in photoshop, created by me):
2
Answers
Use
substr()
with a -Ve number on the 2nd argument.You can use PHP’s
substr()
method with a negative offset:From the Manual: