0

Everything I have tried doesn't seem to work so I thought I would stop in here to see the experts.

Is it possible to write the following into a $whatever = ''; ?

I had some people try and while they sort of got it to work they broke the main functionality of it. So if possible I would like all of the below code written into a functiong variable. If it can be done but needs to be written into multiple variables thats fine so long as all of the variables can be turned into one in the end like so.

$1 = 'John ';
$2 = 'is ';
$3 = 'great.';
$4 = '$1.$2.$3';

then using $4 I would get the singular output of John is great.

Anyway, here's the code and ty for your time and help.

$birthday_date = '2010-02-25';
	$current_date = date('Y-m-d');
		
	list($birthday_year, $birthday_month, $birthday_day) = explode("-", $birthday_date);
	list($current_year, $current_month, $current_day) = explode("-", $current_date);
 
	if ($birthday_month == $current_month && $birthday_day == $current_day) {
		echo 'Happy ', addOrdinalSuffix($current_year - $birthday_year), ' B-Day myu2sig.com !';
		echo "\n";
	}else{
		echo dateDiff(1267074000, time(), 4) . "\n";
	}

Ps; I know that $birthday_date & $current_date are already in this type of format but I use other code thats like it which would cause interferrance so they need to be written in somehow as well even if it's a variable in a variable like $1 = '$2 = 2;';

Ty for your time, also if need be I can toss in like $5 for a working solution paid via PayPal.

3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by MoreBloodWine
0

I don't know if this is the problem or not (i'm sleepy at the moment) but the first thing I noticed is that you used "," and not "." to concatenate.

0

Well, PHP is not my strong suit and the used code isnt mine. O've just made the required edits to get the desired display.

0

hi, dear

try to change the this line

echo 'Happy ', addOrdinalSuffix($current_year - $birthday_year), ' B-Day myu2sig.com !';
echo 'Happy '. addOrdinalSuffix($current_year - $birthday_year). ' B-Day myu2sig.com !';
0

Didnt help but took another route to solve my problem, thx to everyone who tried to help me ;-)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.