Check it out... I have a variable that equals "9180055512121234567" and I want to echo/print just the first 12 numbers to the web page and just drop off the last 7 numbers as these are long distance dialing codes that should not get printed.
So basically I want to format/PARSE off just the first 12 characters into a new variable.
I can do it in VB but have spent DAYS now trying to do this with PHP. IT seems sooooo esay yet I cant find PHP to just do this for me. I though it would take 5 minutes to do somthing like this as when I did it in VB but man this is becoming a joke.
Please tell me that PHP can do this?
Moderator: General Moderators
-
ilovetoast
- Forum Contributor
- Posts: 142
- Joined: Thu Jan 15, 2004 7:34 pm
Let there be code:
And it was good.
substr - Manual entry
peace
Code: Select all
$foo = "9180055512121234567";
$bar = substr($foo, 0, 12);
print $bar; // prints 918005551212substr - Manual entry
peace