Jump to content

lispwriter

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Everything posted by lispwriter

  1. I've had to write my own newline to br code - this last post should work. The issue is you have to replace both "\n" and "\r" characters. str_replace should work for both. Just replace one of the two with <br> and the other with an empty string.
  2. Hmm...I'm not sure what you did there. In my experience with these Linux distros (only been using Ubuntu for about a year and a half) you simply look for the "Live CD" release which gives you an ISO which you then burn to a CD. Boot your system with that CD in the drive and you'll be able to boot into the linux distro you downloaded. Most of them provide an interface from within that Live system to make the actual install to disk - some offer that option as a boot menu before loading the system (Ubuntu does it like that). When creating a dual boot you'll have to pay close attention to what you're doing when you get to your options for partitioning the drive during the Linux install. Make sure you don't take the default resize as they tend to squish your Windows partition down to almost exactly the amount of space they are currently taking up on the drive (obviously windows wouldn't like that much).
  3. since you exploded by spaces, the variable $string is an array of 5 elements, each array element is a single word from your initial string. so $string[0] would hold the value "Hello". within the foreach loop, $a holds the value of a single element from your $string array, one at a time. so on the first iteration $a holds the value "Hello". on the second it holds "this" and so on. also in a foreach loop, unless you need the key values, you can simplify what you wrote like this: foreach($string as $a) { ... } also, as mentioned, it's probably not necessary to use the & operator to pass those values by reference however it couldn't hurt if you're dealing with massive amounts of data as you said. hope that helps.
  4. I don't think it would hurt though I don't think it would be necessary unless you're talkin' about a really massive text file. I don't think I'd go to using references there unless I found that the code was consuming too much memory.
  5. After I thought about that again I'd only use preg_match there if I intended to snatch up the value after the last | with it as well // lazy style preg_match('/sitetitle\|(.*)/',$lineFromFile,$arMatches); // $arMatches[1] would contain "John's Hardware"
  6. preg_match never fails me for finding stuff in strings. I'd loop through the file and test each line using that. so if you need to find 'sitetitle' then preg_match('/sitetitle/',$lineFromFile) will return something that evaluates to true when $lineFromFile has 'sitetitle' in it somewhere. that should find it just fine. if you open your text file into an array with file() then you can loop through the file very easily. you can also use explode() to break the line up like this: list($friendly,$name,$value) = explode("|",$lineFromFile);
  7. VLC for sure. mplayer is great for playing files already on your computer but the only reason i installed it was to use it with mencoder for transcoding and other various video editing tricks. it's totally not necessary if you're looking to just play videos or to stream stuff off of the Internet. VLC will work for all of that common stuff.
  8. narrowing it down - it has to be a server configuration issue due to the error you got. my guess is that your system isn't recognizing what to do with the domain name. can you pull up other pages in your server's directory tree and just not the phpmyadmin page? can you pull up phpmyadmin by using 'localhost' or '127.0.0.1' instead of your domain name? i haven't done it myself (i always just use 'localhost' on my testing server) but to get a custom host name like that on your own system i'm positive you have to establish it in the file /etc/hosts. that's the only way your system will know that the url you typed in is resolved on your system and not somewhere else. so if you haven't set that up yet check that out. just do a quick search for "edit /etc/hosts" and you'll find some help on editing that file. also - i noticed in your apache config file there that you have all access blocked to the phpmyadmin root folder - was that just for testing?
×
×
  • 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.