By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,614 Members | 1,674 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,614 IT Pros & Developers. It's quick & easy.

Chopping a string

P: n/a
Hi! I'm wondering if there is an easy way to divide a string into two parts
(and save them into two varibles).

The things is that I'm trying to chop a file name in two with the name in
one variable and the extension in another.

Tnx
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Never mind! I got it :)

"Dag Eilertsen" <da****************@broadpark.no> wrote in message
news:40******@news.broadpark.no...
Hi! I'm wondering if there is an easy way to divide a string into two parts (and save them into two varibles).

The things is that I'm trying to chop a file name in two with the name in
one variable and the extension in another.

Tnx

Jul 17 '05 #2

P: n/a
"Dag Eilertsen" <da****************@broadpark.no> wrote in message news:<40******@news.broadpark.no>...
Hi! I'm wondering if there is an easy way to divide a string into two parts
(and save them into two varibles).

The things is that I'm trying to chop a file name in two with the name in
one variable and the extension in another.

Tnx


A simple way to do it (so long as there is only one dot in the file name)
list($name, $ext) = explode('.', $fileName);
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.