Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
splitting pHP strings
Old 08-19-2004, 05:24 AM splitting pHP strings
Junior Talker

Posts: 1
Trades: 0
Hi,
I've recenty transformed some XML with XSL and PHP. as shown in the code below.
Now i need to split the $html string (which is the resultant HTML output of the XML file)
into single characters instead of printing it to screen. Inhave tried the ususal PHP methods for splitting a string, nothing seems to work. I have also tried putting the string into an array. Again, nothing works. Could anyone please help me?

<?php

// Create an XSLT processor
$xsltproc = xslt_create();

// Perform the transformation
$html = xslt_process($xsltproc, 'results1.xml', 'results1.xsl');

// Detect errors
if (!$html) die('XSLT processing error: '.xslt_error($xsltproc));

// Destroy the XSLT processor
xslt_free($xsltproc);
//print out the HTML
echo $html;

?>

Thanks

Jo
jocuddy10 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-19-2004, 06:14 AM
webwoRRks's Avatar
Ultra Talker

Posts: 426
Location: I hope so
Trades: 0
OK, to split a string with PHP, we very rarely use split() (don't ask). We use explode().
IE;

PHP Code:
<?php

$my_string 
"hello thar world!";
$my_array explode(" ",$my_string); // Split at the spaces
print_r($my_array);

?>
Does that answer you're question at all, or was I way off?
__________________
Theres 10 types of people; those who understand binary, and those who don't.
webmaster and webdeveloper resources,
Please login or register to view this content. Registration is FREE
webwoRRks is offline
Reply With Quote
View Public Profile Visit webwoRRks's homepage!
 
Reply     « Reply to splitting pHP strings
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.51866 seconds with 12 queries