הרשם שאלות ותשובות רשימת חברים לוח שנה חיפוש הודעות מהיום סמן פורומים כנקראו

   
|!|

 
 
כלים לאשכול תצורת הצגה
Prev הודעה קודמת   הודעה הבאה Next
ישן 26-10-06, 16:20   # 3
lalamen
חבר פורום
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
גיל: 34
הודעות: 328

lalamen לא מחובר  

ציטוט:
נכתב במקור על ידי RS324
אתה יכול לראות את הקוד של ההחלפה ?
ואיזה אותיות אתה רוצה להחליף באיזה מספרים ?
זה מה שעשיתי

PHP קוד:
function love($you,$them)
    {
        
$you  addslashes($you);
        
$them addslashes($them);
        if(empty(
$you) OR empty($them))
        {
            return 
'<a href="#" onclick="history.go(-1); return false;" class="error">בדוק שמילאת נכון את כל השדות!</a>';
        }
        else 
        {
            
$you_length  strlen($you);
            
$them_length strlen($them);
            
$love_count  0;
            for(
$count 0$count<$you_length$count++)
            {
                
$letter1 $you{$count};
                if(
$letter1 == 'א')
                {
                    
$love_count += 2;
                }
                if(
$letter1 == 'ה')
                {
                    
$love_count += 2;
                }
                if(
$letter1 == 'ב')
                {
                    
$love_count += 2;
                }
                if(
$letter1 == 'ה')
                {
                    
$love_count += 2;
                }
                if(
$letter1 == 'ל')
                {
                    
$love_count += 3;
                }
                if(
$letter1 == 'ע')
                {
                    
$love_count += 1;
                }
                if(
$letter1 == 'ד')
                {
                    
$love_count += 3;
                }
            }
        
            for(
$count 0$count<$them_length$count++)
            {
                
$letter2 $them{$count};
                if(
$letter2 == 'א')
                {
                    
$love_count += 2;
                }
                if(
$letter2 == 'ה')
                {
                    
$love_count += 2;
                }
                if(
$letter2 == 'ב')
                {
                    
$love_count += 2;
                }
                if(
$letter2 == 'ה')
                {
                    
$love_count += 2;
                }
                if(
$letter2 == 'ל')
                {
                    
$love_count += 3;
                }
                if(
$letter2 == 'ע')
                {
                    
$love_count += 1;
                }
                if(
$letter2 == 'ד')
                {
                    
$love_count += 3;
                }
            }
        
            
$amount 0;
        
            if(
$love_count 0)
            {
                
$amount 5-(($you_length+$them_length) / 2);
            }
            if(
$love_count 2)
            {
                
$amount 10-(($you_length+$them_length) / 2);
            }
            if(
$love_count 4)
            {
                
$amount 20-(($you_length+$them_length) / 2);
            }
            if(
$love_count 6)
            {
                
$amount 30-(($you_length+$them_length) / 2);
            }
            if(
$love_count 8)
            {
                
$amount 40-(($you_length+$them_length) / 2);
            }
            if(
$love_count 10)
            {
                
$amount 50-(($you_length+$them_length) / 2);
            }
            if(
$love_count 12)
            {
                
$amount 60-(($you_length+$them_length) / 2);
            }
            if(
$love_count 14)
            {
                
$amount 70-(($you_length+$them_length) / 2);
            }
            if(
$love_count 16)
            {
                
$amount 80-(($you_length+$them_length) / 2);
            }
            if(
$love_count 18)
            {
                
$amount 90-(($you_length+$them_length) / 2);
            }
            if(
$love_count 20)
            {
                
$amount 100-(($you_length+$them_length) / 2);
            }
            if(
$love_count 22)
            {
                
$amount 110-(($you_length+$them_length) / 2);
            }
        
            if(
$amount 0)
            {
                return 
$amount 0;
            }
            else if(
$amount 99)
            {
                return 
$amount 99;
            }
            else 
            {
                return 
$amount;
            }
        }
    } 
זה מחשבון אהבה שהמרתי מקוד js לphp על פי בקשה של מישהו הינה הוא בפעולה
http://wrzil.net/calculator.php?act=love
בדוגמא שמשנים את הקידוד לwindows-1255 אז זה פועל לי.
  Reply With Quote
 

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 

כלים לאשכול
תצורת הצגה

חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 22:11.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ