how to split a string and stored in a php variable -


i split long string 3 parts.how can stored in 3 different variables in php. code is

<?php $str = "q5vrfsc+6rs08jlvwdmc/sqwr6mpptzo/p6uh+bpdbe="; $parts = str_split($str, strlen($str)/3+1); print_r($parts); ?> 

the output is

array (      [0] => q5vrfsc+6rs08jl      [1] => vwdmc/sqwr6mppt      [2] => zo/p6uh+bpdbe=  ) 

pls me

this should work you:

$str = "q5vrfsc+6rs08jlvwdmc/sqwr6mpptzo/p6uh+bpdbe="; $parts = str_split($str, strlen($str)/3+1); echo "a = " . $a = $parts[0] . "<br />"; echo "b = " . $b = $parts[1] . "<br />"; echo "c = " . $c = $parts[2] . "<br />"; 

output:

a = q5vrfsc+6rs08jl b = vwdmc/sqwr6mppt c = zo/p6uh+bpdbe= 

with code can output $a, $b, $c , single parts of string


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -