Function example help
| From: | Michael Seton | Date: | Mon, 19 Jan 2009 05:05:43 +0000 |
| Subject: | Function example help | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-3578@lists.php.net to get a copy of this message | ||
*Webmaster,
Im new to php and have been learning it however i have found something complex that I can't seem to find help on,
If you could recommend a place i can ask for help at that would be great just incase you can help here is what i need*
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
im working with a datafeed and i want to to be able to pull the information out of the datafeed into a database,
datafeed being at an external source,
External Source being: websiteURL with php datafeed
_
the information example is as follows (put between horizontal lines for clarification)_
------------------------------------------------------------------------
CAB-CAT5-0.5M;0;Network Cable;Cat 5 Cable - 0.5M;Generic;2.0000;;0.50;1;misc/cables.jpg;EOF<br>
------------------------------------------------------------------------
_in most cases the information is on a single line however in other cases its in multiple lines and has html code eg below:_
------------------------------------------------------------------------
32647-SINGLE;10;Media;Iomega Zip Single Media 250mb Pc/mac;IOMEGA;15.0000;ZIP DISKS, AN EASY-TO-USE & VERSATILE STORAGE SOLUTION<br>PI DATE : DECEMBER 2003<br>MEDIA TYPE : ZIP Cartridge<br>TOTAL DATA CAPACITY (MBYTE) : 250MB<br>PLATFORMS SUPPORTED : PC /Mac<br>MEDIA COMAPTIBILITY : Read/writeable on all Zip 250MB & 750MB drives<br> (Not compatible with Zip 100MB drives)<br>PACKAGE QTY : Single Disk<br>
Warranty Details <br>
Warranty Period: 12 month warranty from end user invoice, 5 years on media.<br>Extended Warranty: NA<br>Return To: Iomega - (88)8888-8888<br>Complete Product: Products will be replaced exactly as they are returned.<br>Comments: <br> purchase req. End user to pay freight to NCH, NCH pays <br> <br>DOA Period: <br>Return To: Iomega - (88)8888-8888<br>Complete Product: Must be returned complete in original packaging<br>Comments: <br>
Technical support is available from<br>Ph: (88)8888-8888<br>Fax:(88)8888-8888<br>http://www.iomega.com/support/index.html <br>
Vendors Web Address <br>
www.iomega.com.au <br> ;0.56;1;;EOF<br>
------------------------------------------------------------------------
I cant seem to find anything that explains how to convert it to put it into a database as follows
when script is run
1. find 'EOF<br>' and remove
2. find '&' and replace with '&'
3. scince there are no categories in the php source file i need to add categories and split the code into categories keeping the html format unchanged however with the above changes so i can keep the formatting
4. Categories needed 'model'; 'qty'; 'category'; 'description_short'; 'vendor'; 'new_price'; 'description_ext'; 'weight'; 'backorder'; 'server_image_location';
(headings specified will be changed just showing how many i need to pull from database)5. find '$server_image_location'; and add to download list then download to our server 6. add '$supplier'; '$server'; to each array 7. if there is an entry in the database already it should keep the existing information & update as necessary for example if there is no description then it should update it, price changes it should record the previous price and then update the price to the new one eg $price becomes $old_price and $new_price becomes $price, if there is no $server_image_location apply no_image.jpg ---------------------------------------------------------------------------------------------------------------------- * Thanks for your time, any help would be appreciated Michael Seton xtpickles@gmail.com*