Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Programming Help > PHP Programming Help

PHP Programming Help Post any question relating to PHP Programming here and hopefully someone can help.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2007-11-24, 10:52 AM
Junior Member
 
Join Date: Nov 2007
Posts: 2
galayman is on a distinguished road
Default capture a specific string

Hi all, i'm a beginner who love php and have this problem, i'm already download lots of ebook of php to solve this problem, but i think i do not know how to solve this.
This is my problem :

I have a data and i put it all together inside a variable called DATA,
this is what inside of $DATA after i gather all the data that i needed.

$DATA = "
_RANDOM DATA_ copyright of me and you 2007 and the others bread 15.22 44.97% crumbs 15.532 6.47% apple 146.932 6.555% coffe 83.72 6.537% thank you all friend and everyone data date and year 2007 _RANDOM DATA_
";

i need to only capture this data and remove the others:
bread 15.22 44.97% crumbs 15.532 6.47% apple 146.932 6.555% coffe 83.72 6.537% thank you
and split it and make each data inside another variable, like this :

$a = bread 15.22 44.97%
$b = crumbs 15.532 6.47%
$c = apple 146.932 6.555%
$d = coffe 83.72 6.537%
$e = thank you

i have an idea to search the bread string and remove any character before it and find the thank you string and remove any character after the thank you string
even there is a lot of random data before the string bread and after the thank you string
and also the data that i try to capture is random, but always in this order : letter - number - number like bread - 15.22 - 44.97%

can this be done?

Thank you for your help and sorry for my english.

Best Regards
Reply With Quote
  #2 (permalink)  
Old 2007-11-24, 11:56 PM
Junior Member
 
Join Date: Nov 2007
Posts: 2
galayman is on a distinguished road
Default

problem solved, no need to reply
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.5 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.5 (a popular PHP IDE) and NuCoder 2.0 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:12 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.