Now this is the testing stage and I wanted results I can be sure of and not just guess at it.
I want it to print
$testingh
no period or anyother non-word character, but right now I'm working on forcing it to display at least $testingh.bklj
Until I get that far, It wont help to stop it at the period or other non-alphanumerical character.
Any help is appreciated.
On a side note, sorry guys, been working like crazy for the last week and it wont let up for at least a month so I'll still be around just not anywhere near like I used to be. Weekends are all booked too.
I know I'm so loved here
Hopefully I'll be back on a role soon enough, Just want to put the spare time I have into this project and a few others.
Joined: Feb 21, 2006 Posts: 1497 Location: In front of a screen....HELP! lol
Posted:
Sat Aug 05, 2006 8:23 pm
Ok got it.
I did this:
$included_files = get_included_files();
foreach ($included_files as $filename) {
echo "$filename\n<BR>";
$file_contents=file_get_contents($filename);
//break down into components to turn into an array
$break=preg_split("/(\\$)/",$file_contents,-1,PREG_SPLIT_DELIM_CAPTURE );
//Join the components to make $,varname look like $varname and turns into a string again.
$string=join(',',$break);
//set search so that it will not count these as var names
$split=array('-','=','(',')',';','[',']','/','+','"','<','>','\'');
$string=str_replace('$,','$',$string);
$string=str_replace('.',',',$string);
$string=str_replace(' ',',',$string);
$string=str_replace($split,',',$string);
$string=stripslashes($string);
//format now complete, each var name should be in the correct format with other data not being necessary so lets rejoin them but now as an array
$string=preg_split('/[,]/',$string);
//print_r ($string);
//break the array up into its components.
foreach($string as $string2){
//dont show unecesary junk
$var_test=eregi('\\$',$string2);
if($var_test ==1 AND $string2!='$'){
//global $string1;
//$string1=array($string1,$string2);
echo "$string2<br>";
Hey look I'm learning regular expressions, go me
Now to Put this in a string to verify no duplicates, then to globalize all the variables to show what they are meaning.
I started working on an offsite content block but it kinda turned into a diagnostic script tool.
Joined: Feb 21, 2006 Posts: 1497 Location: In front of a screen....HELP! lol
Posted:
Sat Aug 05, 2006 9:28 pm
Yeah It does rock, but I like the old fashion search('something','in_something')
but reg ex allows for a lot more functionality, but HARDER to code.
I think I'm getting it down took me about an hour to come up with those
With time.
I decided to do even more with this, I wrote all the included files into one big file.
This should help someone to know which files are actually making up the files being loaded. All in one package should make it easier for people to find errors.
Still a LOT to be done.
I think an early retirement may be necessary
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum