Jump to content


Photo

splitting variables


  • Please log in to reply
1 reply to this topic

#1 taith

taith
  • Members
  • PipPipPip
  • Advanced Member
  • 1,514 posts
  • LocationCanada

Posted 09 June 2006 - 02:53 PM

hey all,
just wanting a simple way to split a variable...
wanting something like
<?
$v1{3}$v2{3}$v3{4} = $variable;
?>
but i doubt its that simple...
90% of computer issues exist between the seat, and the keyboard.

#2 Fyorl

Fyorl
  • Members
  • PipPipPip
  • Advanced Member
  • 273 posts
  • LocationUK

Posted 09 June 2006 - 03:02 PM

I don't know exactly what you mean but you can use $variable = explode('|', $var); which splits a string by the | character and puts each section in an array. $v1{3} will get you the 4th character in a string. Doing $variable = $v1{3} . $v2{3} . $v3{4]; will do what you put above
[table]



Don't worry, the printer fairies will sort it out.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users