Results 41 to 42 of 42
-
1st Aug 2012, 05:59 PM #41MemberWebsite's:
tehMoviez.com 0Senes.com GeekFaceGames.comxml/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();
}
}
?>JokerHacker Blog
JokerHacker PHP coding Service // back again!
CurlAxel PHP Download Accelerator
hardly remembering the milk :p
-
26th Aug 2012, 06:09 PM #42Member
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
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Plz Help To Add A Php Snippet Into My DLE Index !
By JoomlaZ in forum Web Development AreaReplies: 0Last Post: 7th Jul 2011, 01:18 PM -
[C#] Tiny Web Server (snippet)
By Hyperz in forum Web Development AreaReplies: 6Last Post: 24th Jun 2010, 01:19 PM -
Image Upload in php. Code snippet #2
By SplitIce in forum Tutorials and GuidesReplies: 5Last Post: 31st Oct 2009, 07:40 AM -
See real OOP (Snippet from Litewarez V2) Webmasters CP
By litewarez in forum Tutorials and GuidesReplies: 21Last Post: 19th Sep 2009, 03:59 PM -
A Snippet from my latest project
By litewarez in forum Tutorials and GuidesReplies: 19Last Post: 21st Jun 2009, 05:17 PM
themaPoster - post to forums and...
Version 5.11 released. Open older version (or...