Jump to content

[SOLVED] printf Not Accepting Variables for Arguments


TripleDES

Recommended Posts

sorry want to replace somethink use.

[code]
<?php

$x=str_replace("this_word","to_this_word",$from_this_varable);

echo $x;

?>

 

 

<?php
$contents = 'Replace me %1$s and %2$s';
$args = '$parts[0],$parts[1]';
$x=explode($args);
printf($contents, $x);
?>

 

ps. use explode/implode  your first post.

 

i might be wrong theo sorry?[/code]

Reed this please ok.

 

http://uk2.php.net/print_f

 

I did, but it wasn't much help.

 

What are your "Part" array assigned to?

 

Not quite sure what you're asking.  Anyway, I see where it's hanging up.  It doesn't seem to like me feeding multiple arguments separated by commas.  If I do

$a = $parts[0];

$b = $parts[1];

 

then printf($contents, $a, $b) it works....

 

but $args = $parts[0], $parts[1]; breaks

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.