Bağışlayın bayaxkı kodu səhv verdim deyəsən. Bu kodu yoxladım işləyir:
[code]<?php
$text = 'Adim – Ayxan Mesajim – PHP gozel bir proqramlashdirma dilidir Saat – 22:27';
//$axtar = ‘Test’; bu lazım deyil bunu silirik
preg_match('/Mesajim – (.*?) Saat/mis', $text, $a); // /i yerinə /mis yazaq
$tapilan_soz = $a[1];
echo $tapilan_soz; // bize PHP gozel bir proqramlashdirma dilidir verecey
?>[/code]
$text = 'Adim - Ayxan Mesajim - PHP gozel bir proqramlashdirma dilidir Saat - 22:27';
//$axtar = 'Test'; bu lazım deyil bunu silirik
preg_match("/Mesajim - (.*?)/mis", $text, $a); // /i yerinə /mis yazaq
$tapilan_soz = $a[0];
echo $tapilan_soz; // bize PHP gozel bir proqramlashdirma dilidir verecey
[code]
$text = file_get_contents("test.dat");
$axtar = 'Test';
preg_match("/{$axtar}/i",$text,$a);
$tapilan_soz = $a[0];
[/code]
Bazadaki məlumatları tərsinə oxumaq
Php While Loop da Row ların birləşdirilməsi və link məsələsi