Jump to content

Issue with 2


holladb

Recommended Posts

I have a variable being sent over and i need to grab the first 2 characters...i've tried a couple different things but nothing seems to work. Here is what i had last:

 

$code1 = $_POST['code1'];
$a = count_chars($code1, 2);
foreach (count_chars($code1,1) as $i => $val) {
   $item .= chr($i).",";
}	
//$item = sort($item);
$c = array($item);
echo $c;
echo $item;
//echo "<b>".$1."<b>".$2;
echo $a;

 

Now this way works in the sense that it puts it in an array and i will be able to explode it and list each variable but it mixes up the format. For instance if the post variable of code1 was AB12 it would put 21ba. So that wont work.

 

Anybody have a solution??

Link to comment
https://forums.phpfreaks.com/topic/80211-issue-with-2/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.