PHP - Merging 3 Arrays
Hi there,
I am using HTML forms to post values from a data entry page. When they arrive on the second page - I have to extract them from the POST array. This is fine, but I now have to merge them somehow. When I use print_r to view the POSTed data, I see: Code: [Select] [namesUnem] => Array ( [0] => Brian [1] => Richard [2] => Sarah ) [commentsUnem] => Array ( [0] => Brian Comments here [1] => Richard Comments should be entered here [2] => Sarah's Comments were also entered here ) [namesHW] => Array ( [0] => Sally [1] => Kate [2] => William ) [commentsHW] => Array ( [0] => Sally Comments here [1] => Kate's Comments should be entered here [2] => William's' Comments were also entered here ) There are 2 more such arrays being POSTed. I would need to merge in order to see the following: Quote [Name] => Brian [Comment] => Brian Comments here [Type] => namesUnem [Name] => Richard [Comment] => Richard Comments should be entered here [Type] => namesUnem [Name] => Sarah [Comment] => Sarah's Comments were also entered here [Type] => namesUnem [Name] => Sally [Comment] => Sally Comments here [Type] => namesHW [Name] => Kate [Comment] => Kate's Comments should be entered here [Type] => namesHW [Name] => William [Comment] => William's' Comments were also entered here [Type] => namesHW Any help greatly appreciated Kindest Regards AikenD Similar TutorialsHi wondering if there's a simple way to merge or update the data from one array to another . I've tried merge data but it just adds additional records rather than merging them off one common key.
The array is just simply adding a name to another array the format of both is as follows
Array 1
[0] => stdClass Object ( [name] => [market] => Football [selection] => 7051575 ) ) Array 2 Array ( [0] => stdClass Object ( [name] => Something [market] => [selection] => 7051575 ) ) There are other fields but I'm just trying to merge the name from Array two into Array one using the selection as a common key. Is there an easy command like merge or do I have to loop thru the arrays to add the data. Thanks Hi guys,
I wonder if you can offer any advice?
I have two user database tables that are about 70% identical. The problem is that with one of them, the phone number for each user has been cut short by two digits (it was an error on my part early on in the database design).
What I need to do is to get the values from both tables and put them into separate arrays then compare the arrays in a loop. If, say, the first five digits of the phone number in each row of the first table match one entry in the second table then update the second table with the phone number (the full length one).
I'm about puzzled about how to approach this, I've still got a lot to learn about array functions, it seems like it should be fairly simple but I'm a bit lost as to where to begin.
Any advice would be massively appreciated!
What I'm looking to do is analyze an array of coordinates and generate a convex-hull type outline of all independent polygons merged. Convex hull isn't ideal for my situation as I need the outline detailed. From: To: This is how the data is arranged (The keys are just for reference): $array['Group_01']['Polygon_01'] = array('latitude, longitude', 'latitude, longitude', 'latitude, longitude', etc.); $array['Group_01']['Polygon_02'] = array('latitude, longitude', 'latitude, longitude', 'latitude, longitude', etc.); $array['Group_01']['Polygon_03'] = array('latitude, longitude', 'latitude, longitude', 'latitude, longitude', etc.); $array['Group_02']['Polygon_01'] = array('latitude, longitude', 'latitude, longitude', 'latitude, longitude', etc.); $array['Group_02']['Polygon_02'] = array('latitude, longitude', 'latitude, longitude', 'latitude, longitude', etc.); etc. Basically in that scenario I would like to join ALL of the coordinates to form an outline in both 'Group_01' and 'Group_02' based on the polygons in 'Polygon_xx' under that group. Each outline independent of itself. So 'Group_01' would be a union of $array['Group_01']['Polygon_01'], $array['Group_01']['Polygon_02'], and $array['Group_01']['Polygon_03']. Then 'Group_02' would be a union of $array['Group_02']['Polygon_01'] and $array['Group_02']['Polygon_02']. This would output an array of something like $array['Group_01']['Unified'] and $array['Group_02']['Unified'] etc. Is this possible? Any help would be greatly appreciated. Thanks. This must be easy enough, but I'm a noob so go easy on me, please :-)
I have two pieces of code and they're working well on their own. All I need is to put these two conditions into one query.
The first one:
<?php function childtheme_cat_limited_blog( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'events_categories', 'mycategory1' ); } } add_action( 'pre_get_posts', 'childtheme_cat_limited_blog' ); ?>And the second: <?php function childtheme_cat_limited_blog( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'category_name', 'mycategory2' ); } } add_action( 'pre_get_posts', 'childtheme_cat_limited_blog' ); ?>I'm sure it's a piece a cake for you guys, but I can't figure it out for the life of me, so any help would be greatly appreciated! Thank you! (My goal is here to display posts from two categories on a homepage of a Wordpress site, but to complicate things the two categories are from two different post types.) I am new to php. I have been at this for 8 hours and I am not getting anywhere. The objective is to convert the 4-file html/php application into a 1-file php application and generate exactly the same answers and look as the original. I also attached the files. Code: [Select] step1.html: <html> <head><title>STEP1</title><link rel="stylesheet" type="text/css" href="steps.css" /></head> <body> <div class="block"> <form action="step2.php" method="post"> ENTER INPUT1(A or B): <select name="input1"> <option>A</option> <option>B</option> </select> <input type="submit" value="ENTER"/> </form> </div></body></html> step2.php <html> <head><title>STEP2</title><link rel="stylesheet" type="text/css" href="steps.css" /></head> <body> <div class="block"> <?php $choice=$_POST["input1"]; if($choice=="A") { echo "<form action='step4.php' method='post'>"; echo "<input type='hidden' name='input1' value='5'/>"; } else if($choice=="B") { echo "<form action='step3.php' method='post'>"; echo "<input type='hidden' name='input1' value='1'/>"; } else { echo "<form action='step1.html' method='post'>"; } ?> ENTER INPUT2(1-10) : <input type='text' name='input2' size='3'> <input type="submit" value="ENTER"/> </form> </div></body></html> step3.php: <html> <head><title>STEP3</title><link rel="stylesheet" type="text/css" href="steps.css" /></head> <body> <div class="block"> <?php $x="1"+$_POST["input1"]; $y="1"+$_POST["input2"]; $z=(int)$x+(int)$y+2; echo "<div class='output'>OUTPUT: "; if($y<=15) { echo "$z.$y.$x";} else { echo "$x.$y.$z";} echo "</div>"; ?> <div class="note">MAKE SURE TO COPY/WRITE THE OUTPUT</div> <a href="step1.html">RESTART</a> </div></body></html> step4.php: <html> <head><title>STEP4</title><link rel="stylesheet" type="text/css" href="steps.css" /></head> <body> <div class="block"> <?php $xf="1"+$_POST["input1"]; $xz="2"+$_POST["input2"]; $xaq=(int)$xf; $xax=(int)$xz; if($xaq>$xax) {$xaq=$xaq+33;$xax=$xax+31;} else {$xaq=$xaq+2;$xax=$xax+44;} echo "<div class='output'>OUTPUT: "; echo "$xf.$xaq.$xax.$xz"; echo "</div>"; ?> <div class="note">NOTE: MAKE SURE TO COPY/WRITE THE OUTPUT</div> <a href="step1.html">RESTART</a> </div></body></html> [attachment deleted by admin] Hey! I have a bunch of text files with one line of text ex. SHS9GW34 I'm trying to write a little php script on my local machine that will take all the files and put all the different codes in the same files in this kind of format: RGDGIDSG453 EOHBDSBN453 ERGD4535355 etc etc Thanks Hello. I'm currently trying to write a code to merge two separate images together, but for the life of me I can't find anything that works. Basically what I'm trying to do is add a "marking" (cat_stripes.png) to a pet image (cat.png). In the future I also want to use this for adding items to pets and things like that. Both of the images have transparent backgrounds, so that needs to be taken into account. If you haven't got a clue what I'm talking about, look up Wajas or similar virtual pet sites to get an idea of how the markings work. I just need something simple, since I don't have a site set up yet and I'm just testing some things out for a future project. I don't have any codes at the moment, since nothing has worked so far. I'm pretty new to GD too (I'm familiar with all the basic php stuff, so don't panic), so you might need to explain some of the more advanced stuff to me. Any help with this would be really appreciated, thanks. (: Hello guys, I don't really know php but I am always been able to copy/paste it and move stuff around on my wordpress website until now. This last challenge is beyond my skills though (I am sure it will be trivial for you). So I have this code snippet to show a video duration <?php global $post; $video = cbc_get_video_data( $post ); if( $video ) { echo $video->get_human_duration(); } ?> And I have this code to show a post title if ($show_title) { $title_content .= apply_filters( 'uncode_before_body_title', '' ); $title_content .= '<div class="post-title-wrapper"><h1 class="post-title">' . get_the_title() . '</h1>'; $title_content .= uncode_post_info() . '</div>'; $title_content .= apply_filters( 'uncode_after_body_title', '' ); } I want to show the video duration right before the post title and in line with it, so inside the h1 tag. How to do that? Thanks for any help!
When i upload photos and the name of the photo i would like to be able to overlay a portion of the original photo with another image already in the site directory, and also add the photos name over the top of the overlayed image, i may have explained this in a confusing way so i have attached an example. Is this something that can be done using something like GD or imagick, if so could someone please give me a good place to start. $query = "SELECT Table1.*, Table2.A, Table2.B, Table2.C, Table2.D, Table2.E FROM Table1 INNER JOIN Table2 ON Table1.A = Table2.A Issue is that there are multiple matches for some instances, like so: Table1.A value = 1777 (only once since it is a UniqueID) Table2.A value = 1777 (3 records with this ID value) So I will get 3 records returned since Table1.A matches 3 records in Table2.A. I want to merge the 3 records in Table2 into 1 record and then match that with Table1 where the UniqueID is the same. Make sense? I currently have a flat file user registration and login in system. I also have a simple guestbook which i didn't code myself, the guest book currently requires the user to type in there name and e-mail address to make a post. how ever i would like them to have to login and if they aren't logged in then don't display the guestbook. Live version: B50crew.co.uk Guestbook.php: Code: [Select] <?php // find out the domain: $domain = $_SERVER['HTTP_HOST']; // find out the path to the current file: $path = $_SERVER['SCRIPT_NAME']; $url = "http://" . $domain . $path ; extract($_POST); if($Submit){ $date = date('D d Y h:i'); $comment=eregi_replace("\r\n","*",$comment); $comment=eregi_replace("\n","*",$comment); $fp = fopen("bin/guestbook.nfo","a+"); if(!$fp) { echo 'Error: Cannot open file.'; exit; } fwrite($fp, $date."||".$name."||".$email."||".$comment."\n"); fclose($fp); } ?> <div align="center"> <h2><span class="style1">Guestbook </span><br> </h2> </div> <form name="form1" method="post" action="<?php echo $url;?>"> <label>Name <input type="text" name="name"> </label> <label>Email <input type="text" name="email"> </label> <p> </p> <p> comment<br> <textarea name="comment" cols="40" rows="10"></textarea> <br> <label> <input type="submit" name="Submit" value="Sign"> </label> <br> </p> </form> <hr> <?php $userinfo = file("cgi-bin/guestbook.nfo"); echo '<table border="0">'; foreach($userinfo as $val) { //explode that data into a new array: $data = explode("||", $val); echo '<tr><td>'.$data[0].'</td></tr>'; echo '<tr><td>'.$data[1].' Wrote:</td></tr>'; $data[3]=eregi_replace("\*","<br>",$data[3]); echo '<tr><td>'.$data[3].'</td></tr>'; echo '<tr><td>Email:'.$data[2].'<hr></td></tr>'; } echo '</table>'; ?> Login: Code: [Select] <?php // find out the domain: $domain = $_SERVER['HTTP_HOST']; // find out the path to the current file: $path = $_SERVER['SCRIPT_NAME']; $url = "http://" . $domain . $path ; extract($_POST); if($Submit){ $date = date('D d Y h:i'); $comment=eregi_replace("\r\n","*",$comment); $comment=eregi_replace("\n","*",$comment); $fp = fopen("bin/guestbook.nfo","a+"); if(!$fp) { echo 'Error: Cannot open file.'; exit; } fwrite($fp, $date."||".$name."||".$email."||".$comment."\n"); fclose($fp); } ?> <div align="center"> <h2><span class="style1">Guestbook </span><br> </h2> </div> <form name="form1" method="post" action="<?php echo $url;?>"> <label>Name <input type="text" name="name"> </label> <label>Email <input type="text" name="email"> </label> <p> </p> <p> comment<br> <textarea name="comment" cols="40" rows="10"></textarea> <br> <label> <input type="submit" name="Submit" value="Sign"> </label> <br> </p> </form> <hr> <?php $userinfo = file("cgi-bin/guestbook.nfo"); echo '<table border="0">'; foreach($userinfo as $val) { //explode that data into a new array: $data = explode("||", $val); echo '<tr><td>'.$data[0].'</td></tr>'; echo '<tr><td>'.$data[1].' Wrote:</td></tr>'; $data[3]=eregi_replace("\*","<br>",$data[3]); echo '<tr><td>'.$data[3].'</td></tr>'; echo '<tr><td>Email:'.$data[2].'<hr></td></tr>'; } echo '</table>'; ?> Session.php <?php class user { var $file_dir = ""; function start($time = 3600) { session_set_cookie_params($time , ''); session_name('afroxav-login'); session_start(); // Reset the expiration time upon page load if (isset($_COOKIE['afroxav-login'])) { setcookie('afroxav-login', $_COOKIE['afroxav-login'], time() + $time, '', 'localhost', 0, 1); } if (!isset($_SESSION['info'])) { $this->data = array('name' => 'Anonymous', 'logged' => false); } else { $this->data = $_SESSION['info']; } } function check_login() { if ($this->data['logged'] !== true) { return false; } else if ($this->data['logged'] === true) { if ($this->data['name'] !== 'Anonymous') { return true; } return false; } return false; } function login($user, $pass) { $logins_raw = @file_get_contents($this->file_dir . 'users.php'); $logins_processed = str_replace('<?php exit; ?>', '', $logins_raw); $logins_array = explode('\n', $logins_processed); foreach ($logins_array as $id => $line) { $logins[$id] = explode('|', $line); } $pass = $this->hash_pass($pass); foreach ($logins as $user_info) { if ($user_info[1] == $user) { if ($user_info[2] == $pass) { $this->update_session($user_info); return true; } } } return false; } function hash_pass($string) { return hash('sha512', $string); } function logout() { $_SESSION['info'] = array('name' => 'Anonymous', 'logged' => false); $this->data = $_SESSION['info']; return true; } function prep_reg_array($name, $pass, $email, $mod = 'false', $admin = 'false') { $id_raw = @file_get_contents($this->file_dir . 'id.php'); $id = str_replace('<?php exit; ?>', '', $id_raw); $id = $id + 1; @file_put_contents($this->file_dir . 'id.php', '<?php exit; ?>' . $id); return array($id, $name, $this->hash_pass($pass), $email, $mod, $admin); } function register($userdata) { $write = file_put_contents($this->file_dir . 'users.php', '\n' . implode('|', $userdata), FILE_APPEND); return ($write !== false) ? true : false; } function update_session($array) { $_SESSION['info'] = array( 'id' => $array[0], 'name' => $array[1], 'pass' => $array[2], 'email' => $array[3], 'mod' => $array[4], 'admin' => $array[5], 'logged' => true ); $this->data = $_SESSION['info']; } }; //html related functions //not related at all with the sessions function html_start($title) { header('Content-type: text/html'); echo "<html>\n"; echo "<head>\n"; echo "<title>\n"; echo $title; echo "</title>\n"; echo "</head>\n"; echo "<body>\n"; echo "<h1>\n"; echo $title; echo "</h1>\n"; } function html_nav() { global $user; echo "<div>\n"; echo "Navigation\n"; echo "<ul>\n"; echo "<li><a href=\"?page=home\">Home</a></li>\n"; if ($user->check_login() == true) { echo "<li><a href=\"?page=logout\">Log Out</a></li>\n"; } else { echo "<li><a href=\"?page=login\">Log In</a></li>\n"; echo "<li><a href=\"?page=register\">Register</a></li>\n"; } echo "</ul>\n"; echo "</div>\n"; } function html_end() { echo "</body>\n"; echo "</html>\n"; } ?> I have tried many solution, but nothing seems to fix this. The problem is that i put an image with transparency on top of another image, but the transparent pixels still transparent, where they should show some of the image below it. If you call it with l=100 and p=20 i would get this result http://cl.ly/566Z instead of this http://cl.ly/56OF. Here is the source code and I have attached the images: Code: [Select] <?php header('Content-type: image/png'); echo imagepng(progressbar($_GET['l'], $_GET['p'])); function progressbar($length, $percentage) { $length = round($length / 2) * 2; $percentage = min(100, max(0, $percentage)); if($length > 0) { $bar = imagecreate($length, 14); imagealphablending($bar, false); imagesavealpha($bar, true); $empty = imagecreatefrompng('Empty.png'); imagealphablending($empty, false); imagesavealpha($empty, true); $fill = imagecreatefrompng('Fill.png'); imagealphablending($fill, false); imagesavealpha($fill, true); $lempty = imagecreatefrompng('LeftEmpty.png'); imagealphablending($lempty, false); imagesavealpha($lempty, true); $lfill = imagecreatefrompng('LeftFill.png'); imagealphablending($lfill, false); imagesavealpha($lfill, true); $rempty = imagecreatefrompng('RightEmpty.png'); imagealphablending($rempty, false); imagesavealpha($rempty, true); $rfill = imagecreatefrompng('RightFill.png'); imagealphablending($rfill, false); imagesavealpha($rfill, true); $emptycaplength = min(7, $length / 2); //5 imagecopy($bar, $lempty, 0, 0, 0, 0, $emptycaplength, 14); imagecopy($bar, $rempty, $length - $emptycaplength, 0, 7 - $emptycaplength, 0, $emptycaplength, 14); if($length > 14) { imagecopyresized($bar, $empty, 7, 0, 0, 0, $length - 14, 14, 1, 14); } $filllength = round(($length * ($percentage / 100)) / 2) * 2; $fillcaplength = min(7, $filllength / 2); imagecopy($bar, $lfill, 0, 0, 0, 0, $fillcaplength, 14); imagecopy($bar, $rfill, $filllength - $fillcaplength, 0, 7 - $fillcaplength, 0, $fillcaplength, 14); if($filllength > 14) { imagecopyresized($bar, $fill, 7, 0, 0, 0, $filllength - 14, 14, 1, 14); } imagealphablending($bar, true); return $bar; } else { return false; } } ?> Hi,
I'm trying to combine two images - an uploaded image and a permanent. First I try to resize them to the same dimensions. Why I resize the uploaded image to the dimensions of permanent, everything works fine. But when I do the opposite, the images just don't merge, and the output is just the permanent image with resized dimensions. Anyone knows why?
Here is my code:
<?php if( isset( $_FILES['image'] ) ){ $desired_width = 360; $desired_height = 360; $layers = array(); switch($_FILES['image']['type']){ case "image/jpeg": $source_image = imagecreatefromjpeg($_FILES['image']['tmp_name']); break; case "image/gif": $source_image = imagecreatefromgif($_FILES['image']['tmp_name']); break; case "image/png": $source_image = imagecreatefrompng($_FILES['image']['tmp_name']); break; } $frame = imagecreatefrompng("1.png"); $desired_width = imagesx($source_image); $desired_height = imagesy($source_image); $virtual_image = imagecreatetruecolor($desired_width, $desired_height); imagecopyresampled($virtual_image, $frame, 0, 0, 0, 0, $desired_width, $desired_height, 360, 360); $layers = array($source_image,$virtual_image); $image = imagecreatetruecolor($desired_width, $desired_height); // to make background transparent imagealphablending($image, false); $transparency = imagecolorallocatealpha($image, 0, 0, 0, 127); imagefill($image, 0, 0, $transparency); imagesavealpha($image, true); imagealphablending($image, true); for ($i = 0; $i < count($layers); $i++) { imagecopy($image, $layers[$i], 0, 0, 0, 0, $desired_width, $desired_height); } imagealphablending($image, false); imagesavealpha($image, true); header('Content-type: image/png'); header('Content-Disposition: attachment; filename="new_profile.png"'); imagepng($image); } ?> Hello, I want to 'join' two corresponding array values together as in the example below. $one = array('tomato', 'ham', 'bacon'); $two = array('soup', 'sandwich', 'roll'); $final=array(?) //Desired answer = (tomatosoup, hamsandwich, baconroll) Is there a php function that can do this, or a series of functions? I am aware of array_merge but this only alternates the values from what I can see. Ideally there should be a check performed that the two are the same length before completing a merge. New to this, many thanks! I have this thing that i am trying to make but i cant get it to work.. can anyone help? Code: [Select] function sql_read( $dbname,$dbusername,$dbpassword ) { $names = array(); $password = array(); $connect = @mysql_connect("mysql11.000webhost.com",$dbusername,$dbpassword) or die("Could Not Connect"); @mysql_select_db ($dbname) or die("Could not find DataBase"); $query = mysql_query("select * from users"); $numrows = mysql_num_rows($query); if ($numrows > 0){ while($row = mysql_fetch_assoc($query)){ $names[] = $row["uname"]; $password[] = $row["password"]; $id = $row["id"]; } $return = array($names,$password,$id); }else{ $return = array(); } return $return[]; } $names = array(); $names = sql_read("XXXXXX","XXXXXX","XXXXXXX")[0]; The error i get is Code: [Select] Parse error: syntax error, unexpected '[' in /home/a5480952/public_html/sql/index.php on line 28 Line 28 is "$names = sql_read("XXXXXX","XXXXXX","XXXXXXX")[0];" Please help... i REALLLLD need help with this.. ask questions if you want to know more about what i am trying to do... thanks! I'm having troubling with trying to create a function to spit out a single array with the following array. I can write it in a away that looks through the arrays manually. the results i am trying to generate is that each item in generated array. Array to convert array( "account" => array( "login", "register", "logout", "edit", ), "p" => array( "report", ), "array1.0" => array( "array2.0" => array( "array3.0", "array3.1 ), "array2.1", ), generating the array will look like this
Array ( [0] => account [1] => account/login [2] => account/register [3] => account/logout [4] => account/edit [5] => p [6] => p/report [7] => array1.0 [8] => array1.0/array2.0 [9] => array1.0/array2.0/array3.0 [10] => array1.0/array2.0/array3.1 [11] => array1.0/array2.1 ) The idea is that id generates a single array with combined labels and arrays inside, etc. I just can't figure out how to create a script that will create this array even If I add a new value or array.
I have two arrays, both with the same key values. I'd like to combine them. So for instance... Code: [Select] <?php $array1['abcd'] = array( 'value1' => "blah", 'value2' => "blahblah"); $array1['efgh'] = array( 'value1' => "ha", 'value2' => "haha", 'valuex' => "xyz"); $array2['abcd'] = array('value3' => "three", 'value4' => "four"); $array2['efgh'] = array( 'value3' => "hohoho", 'value6' => "six6"); function combine_arrays($array1,$array2) { //*combining* return $single_array; } echo "<pre>"; print_r(combine_arrays($array1,$array2)); echo "</pre>"; /* would produce ['abcd'] = ( 'value1' => "blah", 'value2' => "blahblah", 'value3' => "three", 'value4' => "four" ) ['efgh'] = ( 'value1' => "ha", 'value2' => "haha", 'valuex' => "xyz", 'value3' => "hohoho", 'value6' => "six6" ) */ ?> What's the easiest way to do this? Okay so here is a very simplified version of my code in order to try and illustrate what I am trying to do: $C1 = array (174,30); $C2 = array (165,80); $S = array($C1, $C2); foreach ($S as $cluster) { $number = '5000'; $another_number = '4565'; $cluster[0] = $number; } I feel like this should be really simple but its not working. So basically I'm trying to change the first value of the array select (e.g. C1 or C2) to whatever is in the variable $number. Any help would be greatly appreciated. Thanks Hi, I'm having some trouble trying to generate my random string for a name. This is my code: Code: [Select] <?PHP function rand_string( $length ) { $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $size = strlen( $chars ); for( $i = 0; $i < $length; $i++ ) { $str .= $chars[ rand( 0, $size - 1 ) ]; } return $str; } $salt_string = rand_string( 5 ); $test = "1234"; echo "salt_string = $salt_string"; echo "<br>"; echo "test = 1234"; echo "<br>"; $array = array('$test', '$salt_string'); echo "<br>"; echo "array = $array"; echo "<br>"; $imploded = implode($array); echo "<br>"; echo "imploded = $imploded"; ?> And it returns: salt_string = 8pbAe test = 1234 array = Array imploded = $test$salt_string I don't understand why my imploded variable is not 12348pbAe |