Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

What and where is %s in english.php?


MarcellaE

Recommended Posts

Posted

The only time I've seen the "%s" used is when using sprintf: eg

 

		<?php 

		$url = 'www.google.com';
		$name = 'Google';
		$desc = 'Google Search Engine';

		define('TEXT_INFORMATION', 'For more information, please visit <a href="http://%s">%s</a> ("%s").');

		echo sprintf(TEXT_INFORMATION, $url, $name, $desc);

	?>

 

Will output:

 

For more information, please visit Google ("Google Search Engine").

 

 

Breakdown:

 

sprintf('the line containing the %s', 'the first %s value', 'the second %s value', 'the third %s value');

Archived

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

×
×
  • Create New...