gple Posted June 26, 2007 Share Posted June 26, 2007 If I have a word such as (c_text) in a variable $p. How do I output just text. I know to use the substring function but the text will vary and the amount of characters will vary. Quote Link to comment Share on other sites More sharing options...
obsidian Posted June 26, 2007 Share Posted June 26, 2007 Try this: <?php $string = 'c_text'; for ($i = 0; $i < strlen($string); $i++) { echo $string{$i} . "<br />\n"; } ?> Quote Link to comment Share on other sites More sharing options...
suma237 Posted June 26, 2007 Share Posted June 26, 2007 use explode function $s=explode("_",$p); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.