Jump to content

Nyla

Members
  • Posts

    24
  • Joined

  • Last visited

Nyla's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you Jacques, I'm like a "trial-and-error" parser hahaha -- I try and try and try. But your post is very clear and articulate, and I probably won't have to bother you again for a long time. I appreciate your help, and appreciate you helping me solve the problem at hand. Thank you again, and happy new year!
  2. Hansford, that's cool! But how come your method works? I believe " \s " means space, right? Well does preg_replace treat "new lines" (e.g. "traversing lines" as I referred to?) as spaces? If so, why doesn't .* or .*? work? Doesn't that mean "everything up to" ??? I'm so dumb. I'll learn fast, though, whatever you tell me.
  3. Well Mister Mister, since I don't like being bossed around, I'm going to read, learn, and MEMORIZE the entire PHP manual cover-to-cover, EXCEPT the part about the "s modifier." So there...I'll teach YOU a lesson! LOL THANK YOU!!!
  4. How come preg_replace won't traverse multiple lines? <?php $str = ' one two three four '; echo preg_replace("/two.*three/",'xxx',$str); ?> The result should be: one xxx four ...but it looks like preg_replace doesn't go from one line to the next?
  5. OMG OMG THAT'S IT!!!! FINALLY!!!! That's *exactly* what I wanted. Normally, I say, "I owe you a beer," but in THIS case, I owe you a MARTINI (with the full shebang -- greek olive, orange slice, and the bowl of pretzels!). Of course, I *totally* can NOT understand why it works... it looks like the "secret" is that <div style="clear:both"> which, well, I don't know, how does one even come UP with something so non-intuitive.... it is akin to, "My car won't start," and then a stranger walking up and says, "needs a 2 inch yellow wire instead of the 1 inch black wire." I'm like, Huh? What? Why? Anyway, you fixed it! THANK YOU!!! p.s. I almost slipped back into 1990, and cheated by using <table><tr><td.... LOL
  6. And, no, that doesn't work at all. That ends up looking like (i put dots in it to separate my illustration here): 1 2......3 ........4 Again, I'm wanting 1.........2 3.........4 This is so d*** f****n complicated it's ridiculous. I'll just do a stupid table.
  7. Okay moderator, you're right. My bad.
  8. No, I need to know the principle. They are not 'really' images -- I just tried to make it simple for question/answer's sake. It's really a logo in upper left, a FAQ | Phone | Contact thingy in the upper right, a diagram below the logo, and a paragraph with words/bs underneath the FAQ/Contact thingy.
  9. Thank you for answering, but it does not work -- it does not pin image #2 in the upper right hand corner. Image #1: pinned all the way in upper left hand corner Image #2: pinned all the way in upper right hand corner ...and then, Image #3 directly below image #1, and Image #4 directly below image #2 See, that's the problem I'm been having -- getting #1, and #2 pinned into those corners. What can I change to make that work?
  10. I apologize in advance for such a dumb newbie question I have spent over 4 days trying to get my browser to display 4 images and CANNOT seem to wrap my brain around how to do it: Image #1: upper left hand corner. Image #2: upper right hand corner Image #3: directly below Image #1 Image #4: directly below image #2 I have tried every permutation of "float left/right," "position absolute/relative," etc., and can't make it work. This is what I want: My css code gets the first 2 images where I want them, but the remaining 2 images.... I'm drowning myself in beer right now... hellllllllpppppp <div style="margin:0px 0px 0px 0px;FLOAT:LEFT"> <img src="1.jpg"> </div> <div style="margin:0px 0px 0px 0px;FLOAT:RIGHT"> <img src="2.jpg"> </div> <div style="style=victorian era, with high heels... don't know what goes here to make it work "> <img src="3.jpg"> </div> <div style="no style, ran out of styling cream "> <img src="4.jpg"> </div> THANK YOU!!!!
  11. Oops, sorry I didn't articulate my question very well. I didn't want just one image to commandeer an entire line. Rather, like this (I sketched an image):
  12. Sorry for the really, really basic CSS question. (I'm asking this in the PHP forum, because so far, you've all been nice to me and haven't made fun of some of my really dumb questions.) Image #1 is in the upper left corner of my browser. Image #2 is in the upper right hand corner of my browser. How do I get Image #3 directly below Image #1 and Image #4 directly below Image #2 It should look like this: 1 2 3 4 But no matter what I do (group them into bigger divs, or make position absolute or relative, etc., etc.) what happens is that #3 and #4 get stuck between, or looks goofy. <div style="margin:0px 0px 0px 0px; float:left;"> <img src="1.jpg"> </div> <div style=" margin:0px 0px 0px 0px; float:right;"> <img src="2.jpg"> </div> <div> <img src="3.jpg"> </div> <div> <img src="4.jpg"> </div> Thank you, in advance, for helping!
  13. Thank you for all the replies! Okay, it just became apparant to me that I should have explained all the details, my mistake. So, here goes: 1.) My machine has a mySQL database on it (all 3000 UPC codes, and their corresponding prices). 2.) Another website is #1 on Google, and gets a BAZILLION queries per second. 3.) I provide MY page as an "API page." In other words, when THEIR machine gets a query (e.g. requesting a Price for a particular UPC code), THEIR machine queries MY machine. 4.) Rather than having THEIR machine cause MY machine to do a mySQL lookup a bazillion times a second, I thought it would be faster if my "API page" had a simple Array on it (the Array I described), to provide the result (the "price") for the UPC queries. Now, I'm wondering if I should just "get rid" of the entire array, and have it so when their machine queries MY machine, my machine does a mySQL lookup each time. When THEIR machine accesses my API page (with the big array on it), I always "assumed" that their machine loads my Array into its memory..... but I don't know for sure, I have no way of knowing, and I cannot control whether it does, or does not. My goal is to provide the quickest result possible. Important: When THEIR machine queries my machine, as well as a whole bunch of other websites like mine, whoever returns the result the FASTEST gets on the top of their result list. So, I have an incentive to make my machine provide a result faster! (If a competitor's machine takes 3 billionths of a second to produce a result, I want my machine to only take 2 billionths of a second).
  14. I have a 5000 item array of grocery UPC numbers and prices (here's a snippet): $myarray = array( '3540132662329' => '74.46', '8870132664186' => '63.24', '1090132664313' => '79.56', '6550132671425' => '46.92', '0020132685310' => '37.74', ); When someone inputs a UPC number, a price shows up: echo $myarray["6550132671425"]; // echoes 46.92 Is there anything FASTER than using an array? For example, converting the array into a string like this: $mystring = " 3540132662329-74.46, 8870132664186-63.24, "; ...and then using string functions like strpos, and substr to parse out the price? Or is it better to stick with arrays?
  15. Thank you, Requinex! You have saved my bacon MANY times now! I sure appreciate it! One non-alcoholic beer comin' right up!
×
×
  • 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.