Jump to content

50-50% show text data


egturnkey

Recommended Posts

Hello dear friends,

One of the most lovely idea i was searching for was for 50-50% text show.

 

If i have

 

$text_1 = "i love phpfreak";

 

and

 

$text_2 = "hello my world";

 

and let says i want 

 

$final = "50-50% show btween both text_1/test_2";

 

how to make $final shows either $text_1 or $text_2 with chance 50% to each

 

 

thanks in advance

 

Link to comment
https://forums.phpfreaks.com/topic/195099-50-50-show-text-data/
Share on other sites

* count how many times each text is show

* if counts differ, show the one which is show less times

* if count are equal, pick a random one from both...

 

thanks, upon your idea . i'm feeling i'm so close to understand it

so please keep with me.

 

I will create database table with 2 fields text_1 and text_2

it will record how many times text_1 shown and text_2 shown

 

if both are equal then it will show text_1

then next time

 

it will compare then it found text_1 > text_2

then it shown

text_2

 

ect... is that you mean !!

 

 

i think it is too complex to me to write it but i will try.

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.