Activity Stream
48,167 MEMBERS
62118 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 5 of 5 FirstFirst ... 345
Results 41 to 42 of 42
  1.     
    #41
    Member
    Website's:
    tehMoviez.com 0Senes.com GeekFaceGames.com
    xml/array conversion in php
    PHP Code: 
    <?php
    class XmlArray {
        static function 
    xmlObjToArr($obj) { 
            return 
    json_decode(json_encode($obj), true);
        } 
        
        
        static function 
    arrToXmlObj($root_element_name,$array
        { 
            
    $xml = new SimpleXMLElement("<?xml version=\"1.0\"?><{$root_element_name}></{$root_element_name}>"); 
            
    $f = function($f,$c,$a) { 
                    foreach(
    $a as $k=>$v) { 
                        if(
    is_array($v)) { 
                            
    $ch=$c->addChild($k); 
                            
    $f($f,$ch,$v); 
                        } else { 
                            
    $c->addChild($k,$v); 
                        } 
                    }
            };
            
    $f($f,$xml,$array); 
            return 
    $xml->asXML(); 
        }
    }
    ?>

  2.     
    #42
    Member
    Bringing this thread back...


    A snippet of me using threadpools to load large images into pictureboxes quickly in vb.net:
    Code: 
    For Each kvp As KeyValuePair(Of StreamTypes, Stream) In e.resultStream
    	Select Case kvp.Key
    		Case 0 'key = StreamTypes.Picture
    			fontImage = Image.FromStream(kvp.Value)
    			ThreadPool.QueueUserWorkItem(AddressOf loadPicture)
    		Case 1 'key = StreamTypes.Chart
    			fontChartImage = Image.FromStream(kvp.Value)
    			ThreadPool.QueueUserWorkItem(AddressOf loadChart)
    	End Select
    Next kvp
    My previous username was kaed

Page 5 of 5 FirstFirst ... 345

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Plz Help To Add A Php Snippet Into My DLE Index !
    By JoomlaZ in forum Web Development Area
    Replies: 0
    Last Post: 7th Jul 2011, 01:18 PM
  2. [C#] Tiny Web Server (snippet)
    By Hyperz in forum Web Development Area
    Replies: 6
    Last Post: 24th Jun 2010, 01:19 PM
  3. Image Upload in php. Code snippet #2
    By SplitIce in forum Tutorials and Guides
    Replies: 5
    Last Post: 31st Oct 2009, 07:40 AM
  4. See real OOP (Snippet from Litewarez V2) Webmasters CP
    By litewarez in forum Tutorials and Guides
    Replies: 21
    Last Post: 19th Sep 2009, 03:59 PM
  5. A Snippet from my latest project
    By litewarez in forum Tutorials and Guides
    Replies: 19
    Last Post: 21st Jun 2009, 05:17 PM

Tags for this Thread

BE SOCIAL