Jump to content

Baffling problem joining strings.


Perad

Recommended Posts

Variables print fine. I try to use them 2 lines down and wtf they are not added to the string.

 

The question.

 

How can I add

 

$extention[$ex] to $copyto = $this->config->item('upload_dir') . 'images/'.$newname.'.'

 

How can I add $image to $copyfrom = $this->config->item('upload_dir') . "preview/"

 

print $image.'<br/><br/><br/><br/><br/>';
print $extention[$ex].'<br/><br/><br/><br/><br/>';

$newname = rand('11111111', '99999999');
$copyto = $this->config->item('upload_dir') . 'images/'.$newname.'.'.$extention[$ex];
$copyfrom = $this->config->item('upload_dir') . "preview/" . $image;

Link to comment
https://forums.phpfreaks.com/topic/103561-baffling-problem-joining-strings/
Share on other sites

<?php
echo $l1 = $image.'<br/><br/><br/><br/><br/>';
echo $l2 = $extention[$ex].'<br/><br/><br/><br/><br/>';

$newname = rand('11111111', '99999999');
$copyto = $this->config->item('upload_dir') . 'images/'.$newname.'.'.$l2;
$copyfrom = $this->config->item('upload_dir') . "preview/" . $l1;
?>

 

Like this???

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.