Rheanna Posted October 4, 2015 Share Posted October 4, 2015 I'm very new to php. With help I was able to make this code work: <?php //get_additional is a custom funcion ob_start(); echo get_additional($tcgname,'Trades'); echo nl2br("\n"); echo '<div class="tboxout" style="background: url('.$tcgimg.')">'; echo '<div class="tboxin">'; $buffered = ob_get_clean(); echo $buffered; $times = $buffered; $imgurl = 'myimage.png'; for($i=0;$i<$times;$i++){ echo '<img src="'.$imgurl.'" />'; } echo '</div>'; echo '</div>'; ?> It pulls an image and displays it x amount of times depending on the integer that this part of the code outputs: echo get_additional($tcgname,'Trades'); My question is, how would I go about gathering that integer without actually displaying the information? I don't see how I would use a variable in this situation... Quote Link to comment Share on other sites More sharing options...
scootstah Posted October 4, 2015 Share Posted October 4, 2015 $number = get_additional($tcgname,'Trades'); Quote Link to comment Share on other sites More sharing options...
Rheanna Posted October 4, 2015 Author Share Posted October 4, 2015 That removes all instances of the images as well as the number though... Quote Link to comment Share on other sites More sharing options...
scootstah Posted October 4, 2015 Share Posted October 4, 2015 Can you post the function definition? Quote Link to comment Share on other sites More sharing options...
hansford Posted October 4, 2015 Share Posted October 4, 2015 I've already addressed this in your last post. http://forums.phpfreaks.com/topic/298419-what-am-i-doing-wrong/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.