Jump to content

RobertP

Members
  • Posts

    287
  • Joined

  • Last visited

Everything posted by RobertP

  1. RobertP

    Memcache

    i spent about 3 hours last night on a new laptop setting up my development env. i thought i would share something that might be helpful to many others. This is how to install memcache on windows 7 ultimate 64bit: Step 1: Download the attachment. Step 2: Add the 'php_memcache.dll' extension to your php. Step 3: Install memcache server by executing the following commands. NOTE: run cmd as admin. memcached -d install memcached -d start If you have any questions, please feel free to ask, i will help you as much as i can. 18863_.zip
  2. i am creating an api that connects to various xmlrcp servers that i use often. my api will replace a large section of my website network. updated version: private function parseResponse($response,&$parsedResponse = array()){ foreach($response->children() as $elementName => $node){ $nextIdx = count($parsedResponse); $parsedResponse[$nextIdx] = array(); $parsedResponse[$nextIdx]['@name'] = (string)$elementName; if(count($node->attributes())>0){ $parsedResponse[$nextIdx]['@attributes'] = array(); foreach($node->attributes() as $attributeName => $attributeValue) $parsedResponse[$nextIdx]['@attributes'][trim((string)$attributeName)] = trim((string)$attributeValue); } $text = trim((string)$node); if(strlen($text)>0) $parsedResponse[$nextIdx]['@text'] = $text; if($node->count()>0){ $parsedResponse[$nextIdx]['@children'] = array(); $this->parseResponse($node,$parsedResponse[$nextIdx]['@children']); } } return $parsedResponse; }
  3. i am working on a method that will parse an simplexml to an array if you notice any thing odd or incorrect please let me know private function parseResponse(SimpleXMLElement $response){ $parsedResponse = array(); if(method_exists($response,'attributes')){ $parsedResponse['attributes'] = array(); foreach($response->attributes() as $key => $value) $parsedResponse['attributes'][lcfirst((string)$key)] = (string)$value; } if($response->count()>0){ foreach($response->children() as $value) $parsedResponse[] = $this->parseResponse($value); } return $parsedResponse; }
  4. Write it your own way. But NEVER write it the way smf does ( LOL ).
  5. lawl, no i assume they don't have a company office.
  6. what does this mean? positive look-ahead? (?<!^)
  7. i am in need of a regular expression that will parse my associative array keys into clean strings. example: testKeyString33 = Test Key String 33 dbHost = Db Host simpleStringWithMore = Simple String With More This is how i think it would work... - append a space to all UPPER CASE letters (aSd = a Sd) - append a space to the start of all integers... (asd123 = asd 123) if this is confusing at all, please say so :S
  8. Thank you very much. i think i am going to update my parser to use this method. much easier on the eyes after a few hours :S #\[b](.*?)\[/b]#is
  9. so, is it possible to make this expression any simpler? /\[b\](.*?)\[\/b\]/is i tried this, but i want to remove the backward slashes completely if possible. #\[b](.*?)\[/b]#is
  10. Amazing resource, thank you very much!
  11. i know that there is many 'better' tutorials out there. but when i started out a few years ago;; this really helped me understand the mechanics of the user management system http://www.phpeasystep.com/phptu/6.html
  12. this is the way to do it.
  13. why is this not working? http://gskinner.com/RegExr/?31a9l preg_replace(): Unknown modifier 'b' <?php $string = 'This is a [b]simple BBCode[/b] test. This is another test [b]line[/b]. [b]tt[/b]'; $string = preg_replace('/\[b](.*)\[/b]/gi','<span style="font-size:bold;">$1</span>',$string); echo str_replace("\n",'<br />',$string); ?>
  14. you will need to create a user management system, with different access levels. you will need to create a page for members to view the up coming fights. a page with information about each fight. a page where they can vote bet on a fight. .. and thats just to start.
  15. Thank you so much.. i was playing around with this :S /^&[a-zA-Z0-9-](?!-){3,}$/
  16. i need to make sure my string does NOT end with a dash '-'. /^&[a-zA-Z0-9-]{3,}$/ Any help would be greatly appreciated!
  17. I use namecheap, 9.50 /each (and they often have promos)
  18. I purchased a year lease from them for a shared server. (my first actually) and i left before my first month was done. It took them almost 2 months to change my nameservers for me. When i was there, most php extensions were disabled; everything from sockets,zip,curl,(there is more). They have no support for any sort of cache (memcached,apc). Their customer server sucks beyond belief. I had messed up the permissions on a directory i was trying to delete, and they kept asking me for my cc number for identity (this is understandable, but not once they transfer you to 3-4 different sales reps before sending to the IT department-- each asking the same damn shit). Lets just say you would have better luck hosting your site on some free host rather then godaddy.
  19. I am looking into the zend certification. Is there anything i should know before proceeding? Is the zend certificate something that would help your resume? or just a personal achievement type thing? Also, any tips would be greatly appreciated! http://shop.zend.com/en/zend-php5-certification-voucher.html
  20. i'd have to blame imageshack :|
  21. try something like this var isBoxShowen = false; function showMap(){ if(!isBoxShowen){ showBox(); isBoxShowen = true; } } function hideMap(){ isBoxShowen = false; } ps: i recommend using http://api.jquery.com/visible-selector/
×
×
  • 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.