Current location: Hot Scripts Forums » Programming Languages » PHP » Choice some word - Is it possible


Choice some word - Is it possible

Reply
  #1 (permalink)  
Old 10-30-06, 11:35 AM
mailme420's Avatar
mailme420 mailme420 is offline
Newbie Coder
 
Join Date: Sep 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Choice some word - Is it possible

abcd~vnisdufhisduafjsdlknsdi//xyz
lsdnfsald~sldfjsoidfjsiodfjsoidjfsdij//uiuiiu


i want to retrive data from this lines into ~ to //. before ~ & after // words & number of words are unknown.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 10-30-06, 11:39 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
use preg_match:
PHP Code:

preg_match('/~(\w)+\/\//'$my_text$matches);

echo 
"<pre>";
print_r($matches);
echo 
"</pre>"
this will output an array with all the matches

You could also use strpos and substr

UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help with onChange events nassau JavaScript 4 09-07-06 03:45 AM
multi value hashtable minority ASP.NET 1 03-01-06 09:37 AM
Word Filter in PHP seanknighton Script Requests 0 10-31-05 07:44 PM
Telephone Word Generator necro_mancer C/C++ 4 09-07-05 05:01 PM
Find the beginning letter of a word mcrob PHP 6 05-23-05 11:06 AM


All times are GMT -5. The time now is 06:44 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.