Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About tommytx

  • Rank
    Regular Member

Profile Information

  • Gender
    Not Telling
  1. Thanks that worked perfect.. save it and retrieved it in the exact same state it was in originally... you guys are great.. Maddening you told me where fish and that helped but SEN threw me a couple of fish to get started and speeded up my process significantly as i would have had no idea where to start as i have never used json before.. so he wins.. but i really do appreciate the quick response from both of you.. This is one forum that yu always know you wont need to wait days for help.... Thanks agai.
  2. Thanks will go study json and see if i can figrue it out was going thru all kinks of gyrations but nothing worked.. will come back after i assemble a few hundred json samples..
  3. I am trying to capture some data on the fly that is marked to be inserted in the db.. but its a huge dump and is very slow getting it into the db.but i can download the entire package and save it in text in less than 3 minutes.. so the idea is to capture it on the fly and then once off line move the data to the db.. should save hours of time and not tie up the MLS server so long.. So here is what i need.. Want to capture it on the fly which i can do.. but the question is how do i save it to txtfile so that it can easily be reloaded as an arrray in the future. I can break it apart any way i like and add ticks or quotes or anything and save the pieces.. but surely there is a very efficient way to do if for multi array... as i think its important how its stored if say i winat to pull the arrays quickly from file usging something like $str = file('mytextfile.txt'); Hope all this makes sense.. what follows is an example of sample code that i am experimenting with to see how to work this.. any thoughts or suggestions would be appreciated. $contacts = [['name'=>'S Russell','email'=>'s.russell@vahud.com','title'=>'President'], ['name'=>'D Randall','email'=>'d.Randall@vahud.com','title'=>''], ['name'=>'T Joneses','email'=>'t.joneses@vahud.com','title'=>'Professor'], ['name'=>'A Soloing','email'=>'a.soloing@vahud.com']]; Array ( [0] => Array ( [name] => S Russell [email] => s.russell@vahud.com [title] => President ) [1] => Array ( [name] => D Randall [email] => d.Randall@vahud.com [title] => ) [2] => Array ( [name] => T Jones [email] => t.jones@vahud.com [title] => Professor ) [3] => Array ( [name] => A Solo [email] => a.solo@vahud.com ) ) So how should the code be broken apart and placed in saving.. to easily be reloaded quickly exactly like the array it was since it will be fed back to the same program that it was taken from in midstream.
  4. Hey folks again i have to say you need to cut this post out and add it to your "How to do array notebook as it will be very valuable to you in future resolutions. But I just noticed a possible confusion... some of you may be saying what the heck.. How did he get those values out of that example.. Sorry... i just simplified my version for the forum so here is the actual array i am running.. just so it does not look like i am crazy.. I should have made this match my original example but you can see the reason for my strange values compared to my original question. [0] => Array ( [AdditionalPetRentYN] => [AnnualPropertyTaxes] => 2088 [BathsFull] => [BathsHalf] => [BathsTotal] => [CurrentPrice] => 135000.00 [DOM] => 3412 [MLSNumber] => 857252 [Matrix_Unique_ID] => 8971579 [PhotoCount] => 1 [PostalCode] => 89005 [StreetDirPrefix] => [StreetName] => DENVER [StreetNumber] => 1409 [StreetSuffix] => Street [YearBuilt] => )
  5. Thank you Maddening.. Now this is a prime example of what happens when you teach a man to fish instead of giving him fish.. I took what he provided and finished my own solutions since i did not want to complicate it too much or even ask for help doing my entire project... but the final result was to get all the variables and even have the keys available if needed...so here is what i added totally due to this very exquisite tutorial.. i finished the project... Maddening could not finish it since he had no idea what my final goal was but he did exactly what I asked for... This forum is the best.. not like "stackoverflow" who nitpick everything and if you forget to dot an i or cross a t they ban you.. I will never use them again..For each T that you do not cross you are banned for 3 days...Thankyou phpfreaks and especially Maddening you are the best... So bottom line i took what he gave me and learned from it and did not have to come back with but what if this or what if that.... i figured it out from his expert shove down the road.. foreach ($arrResult["DATA"] as $data) { // $data substitutes for the [0] element foreach ($data AS $key => $value) { echo "Value = $value<br>"; } echo " &&&&& Separator &&&&&<br>"; } Below is the output of my code mod which pulls out every entry for storage... Value = Value = 2088 Value = Value = Value = Value = 135000.00 Value = 3412 Value = 857252 Value = 8971579 Value = 1 Value = 89005 Value = Value = DENVER Value = 1409 Value = Street Value = &&&&& Separator &&&&& Value = Value = 2088 Value = Value = Value = Value = 135000.00 Value = 3412 Value = 857251 Value = 8971581 Value = 1 Value = 89005 Value = Value = DENVER Value = 1407 Value = Street Value = &&&&& Separator &&&&&
  6. This is php programming.. I have tried just about every variation i can think of.. The goal is to be able to pull each value.. Then of course once i know what i need to pull the values i can put it in a loop to get them all. Any assistance offered will be greatly appreciated. print "<pre>"; print_r($myarray); // multiple triple array.. print "<pre>"; Array ( [DATA] => Array ( [0] => Array ( [CurrentPrice] => 135000.00 [MLSNumber] => 857252 [Matrix_Unique_ID] => 8971579 [StreetName] => DENVER ) [1] => Array ( [CurrentPrice] => 135000.00 [MLSNumber] => 857251 [Matrix_Unique_ID] => 8971581 [StreetName] => DENVER ) [2] => Array ( [CurrentPrice] => 135000.00 [MLSNumber] => 857253 [Matrix_Unique_ID] => 8971583 [StreetName] => DENVER ) ) echo [0]['MLSNumber']; echo [0][0]['MLSNumber']; echo $myarray['MLSNumber']; echo $myarray[0]['MLSNumber']; echo [0][0]['MLSNumber']; The above list is some of the attempts i have used to grab the values but negative results.
  7. God bless you both.. i have learned sooooo much on this.. but the part that finally worked for me is removing the [1] like this $param[1]['values']); $param['values'] Should it have worked also with athe [1] looks like it should .. wish i could give yu both a star for such great help... but thank you sooo much.. This line made it all work for me... echo $param['values'] = str_replace(', '', $param['values']);
  8. I don't get any errors.. but when i do it the way you showed.. its seems to work but added it to the end of my array while i need it to repace the existing one.. as you can see it still there in orig form but added at bottom also.. This one did not actually work... foreach($param as $key => $x) { if ($key==1) $param[$key]['values'] = "Las Vegas|600,000"; } but this one did $params[1]['values'] = "Las Vegas|600,000"; but as you can see below it added it to the bottom vice replacing it.. Thank you so much for your help i already understand this much better. Array ( [fields] => City|Price [values] => Las Vegas|$600,000 [template] => similar_listings.php [orderby] => Price [orderdir] => DESC [sort_type] => LOCAL [count] => 3 [masterdb] => 1 [get] => Array ( [sorteddir] => DESC ) [1] => Array ( [values] => Las Vegas|600,000 ) )
  9. I have the following code... Array ( [fields] => City|Price [values] => Las Vegas|$600,000 [template] => similar_listings.php [orderby] => Price [orderdir] => DESC [sort_type] => LOCAL [count] => 3 [masterdb] => 1 [get] => Array ( [sorteddir] => DESC ) ) I want to change auto remove the $ sign on the fly I have tried the following.. since the array is named $param i tried $param[1][values] = str_replace('$', "', $param[1][values]); But it did not work... Then i tried $cnt=0 foreach($param as $x) {if ($cnt==1) $x = "Las Vegas|600,000)$cnt++;} and it failed also. Thanks for any suggestions.
  10. Found the answer.. and placing it here in case anyone else has the same questions Both sublime text and Notepad ++ work fantastic for this.. all you do is hilite the beginning bracket and bingo it takes you to its matching bracket.... Really slick..
  11. Pls don't waste other folks time if you have no idea what you are talking about.. Thanks...
  12. I have seen the capability to put the mouse on the top curly brace for a function or foreach etc and the matching curly brace would lite up.. can anyone steer me to something like that or give me an easy way to find the matching curly brace without having to try to analyze which are open and which are closed till you finally figure out which one is the matching one... Thanks..
  13. Thanks that is exactly the word.. just could not remember for the life of me and i searched around the explode and implode areas but never saw any ref to it.. so totally slipped my mind.. what little i got left.. Thanks again.
  14. I have used this command before and cannot remember the name or how to deploy it.. sorta like implode but different.. what it does is take an associative array and makes individual variables out of the array like this. $str = arrray("dog->catkiller", "house->placetolive:) and when applied results in the following. $dog = "catkiller"; $house = "placetolive"; Can anyone help me with this.. I need the command name and a sample of its use..
  15. Thanks for the information of about the Array A the original program writer chimed in and gave me that very same info... but thanks anyway.. it is working great now... I am sure that when enough folks complain about the extract being a bad command.. they will eventually get around to removing it... meanwhile.. for a very simple ten line program I will contine to use it .. since it is so much faster and simpler to extract the data line by line...
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.