kconley:
Well, it sounds like you certainly have a real challenge ahead of you.
After reading your last posting maybe the "chunk" thing isn't the best way to go.
I'm certainly not a PHP expert by any means. Most of my application development has been with Visual Basic 6 and Access or SQL.
However, there is one PHP string function that might be of some value to you as far as getting the information you are able to retrieve into some workable format.
I don't know if you have used strtok( ) or not, but I used it with the "example of one of the enteries" you listed in your first posting and was able to break the string up into almost a useful format. I think with a little more fooling around with it and it just might work.
Here is a little blip of info about it:
Tokenizing and Parsing Functions
Sometimes you need to take strings apart at the seams, and you have
your own notions of what should count as a seam. The process of
breaking up a long string into words is called tokenizing, and among
other things it is part of the internals of interpreting or compiling any
computer program, including PHP. PHP offers a special function for
this purpose, called strtok().
The strtok() function takes two arguments: the string to be broken
up into tokens and a string containing all the delimiters (characters
that count as boundaries between tokens). On the first call, both
arguments are used, and the string value returned is the first token.
To retrieve subsequent tokens, make the same call, but omit the
source string argument. It will be remembered as the current string, and the function will
remember where it left off. For example
$token = strtok(
“open-source HTML-embedded server-side Web scripting”,
“ “);
while($token){
print($token . “<BR>”);
$token = strtok(“ “);
}
gives the browser output:
open-source
HTML-embedded
server-side
Web
scripting
The original string would be broken at each space. At our discretion, we could change the
delimiter set, like so:
$token = strtok(
“open-source HTML-embedded server-side Web scripting”,
“-”);
while($token){
print($token . “<BR>”);
$token = strtok(“-”);
}
This gives us (less sensibly):
Open
source HTML
embedded server
side Web scripting
Finally, we can break the string at all these places at once by giving it a delimiter string like
“ -”, containing both a space and a dash. The code:
$token = strtok(
“open-source HTML-embedded server-side Web scripting”,
“ -”);
while($token){
print($token . “<BR>”);
$token = strtok(“ -”);
}
prints this output:
open
source
HTML
embedded
server
side
Web
scripting
Notice that in every case the delimiter characters do not show up anywhere in the retrieved
tokens.
The strtok() function doles out its tokens one by one. You can also use the explode() function
to do something similar, except it stores the tokens all at once into an array. After the
tokens are in the array, you can do anything you like with them, including sort them.
The explode() function takes two arguments: a separator string and the string to be separated.
It returns an array where each element is a substring between instances of the separator in
the string to be separated. For example:
$explode_result = explode(“AND”, “one AND a two AND a three”);
results in the array $explode_result having three elements, each of which is a string: “one
“, “ a two “, and “ a three”. In this particular example, there would be no capital letters anywhere
in the strings contained in the array, because the AND separator does not show up in
the result.
The separator string in explode() is significantly different from the delimiter string used in
strtok(). The separator is a full-fledged string, and all its characters must be found in the
right order for an instance of the separator to be detected. The delimiter string of strtok()
specifies a set of single characters, any one of which will count as a delimiter. This makes
explode() both more precise and more brittle—if you leave out a space or a newline character
from a long string, the entire function will be broken.
Because the entire separator string disappears into the ether when explode() is used, this
function can be the basis for many useful effects. The examples given in most PHP documentation
use short strings for convenience, but remember that a string can be almost any
length—and explode() is especially useful with longer strings that might be tedious to
parse some other way. For instance, you can use it to count how many times a particular
string appears within a text file by turning the file into a string and using explode() on it,
as in this example (which uses some functions we haven’t explained yet, but we hope make
sense in context).
<?php
//First, turn a text file into a string called $filestring.
$filename = “complex_layout.html”;
$fd = fopen($filename, “r”);
$filestring = fread($fd, filesize($filename));
fclose ($fd);
//Explode on the beginning of the <TABLE> HTML tag
$tables = explode(“<TABLE”, $filestring); // assumes uppercase
//Count the number of pieces
$num_tables = count($tables);
//Subtract one to get the number of <TABLE> tags, and echo
echo ($num_tables - 1);
?>
The explode( ) function might also be helpful to you:
The explode() function has an inverse function, implode(), which takes two arguments: a
“glue” string (analogous to the separator string in explode()) and an array of strings like
that returned by explode(). It returns a string created by inserting the glue string between
each string element in the array.
You can use the two functions together to replace every instance of a particular string within
a text file. Remember that the separator string will vanish into the ether when you perform an
explode()—if you want it to appear in the final file, you have to replace it by hand. In this
example, we’re changing the font tags on a Web page.
<?php
//Turn text file into string
$filename = “someoldpage.html”;
$fd = fopen($filename, “r”);
$filestring = fread($fd, filesize($filename));
fclose ($fd);
$parts = explode(“arial, sans-serif”, $filestring);
$whole = implode(“arial, verdana, sans-serif”, $parts);
//Overwrite the original file
$fd = fopen($filename, “w”);
fwrite($fd, $whole);
fclose ($fd);
?>
I have also had the thought that you might be better off using some kind of a flat file instead of a database. A flat file should work ok unless you have 100's of these schedulings each day. And, depending on what else you might want to do with the data.
I will let this rattle around in my little pea-brain over the week-end and see if I come up with anything more I can suggest to you.
My background isn't computer programming it is in the legal profession. I spent over 15 years practicing law. I'm not an expert in intellectual property law, but my opinion would be that while your software provider does not have to give you access to their source code or the program they have created to manipuate the data in the database, the information in the database belongs to you and they would have to make the database accessible to you. However, that is a subject best left for another day and perhaps a different forum.
Good Luck