473,396 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to Display multiple data using preg match?

irfanmodan
Hello Everyone...

i have one issue.please help me

My name {is} and.i {am} a php {developer}..how to display value within brecket '{.}'... also that value will be used to fetch value from the database

i use below code but it is display only one value...

Expand|Select|Wrap|Line Numbers
  1. $message="My name {is} abd.i {am} a php {developer}.";
  2. preg_match("/\{([^{}]+)\}/", $message,$matches);
  3.     $find=$matches[0];
  4.     $path=getonefielddata("select path from tbl_plugin where field='$find'");
  5.     return str_replace("$find",$path,$message);
But I want to use all the value to fetch the data from database..so how to display multiple value...

sorry for my worst english...please Help me...

Thanks in advance..
Irfan Modan
Apr 13 '11 #1
2 2214
Dormilich
8,658 Expert Mod 8TB
you use preg_match_all().
Apr 13 '11 #2
Thanks Dormilich...
Its work....

Thank you very much
Apr 15 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: JStrauss | last post by:
Hello, Can anybody give me some tips on the best and/or easiest way to display multiple lines in a field. The data is collected from a "textarea" field when the form is submitted, and I want to...
2
by: toedipper | last post by:
Hello, The following bit of code does a preg match and does something if true (sets $browser to ppcie) Without using if then and else's how do I code it so it does not equal what it is...
1
by: Daman | last post by:
Hi, I am currently facing difficulty displaying chinese, japanese, russian etc. characters. I am using VB 6 and ADO to query the DB2 Version 7.2 unicode database (UTF-8). The resultset that...
12
by: Wadim Grasza | last post by:
I want to store and display (on a form or a report) multiple pictures per record in an access database. The pictures are not stored within the database. They are stored as files and the database...
3
by: Fungi2003 | last post by:
I am binding a datagrid to a dataset but there are some columns I don't want show in the dataset, what is the easiest way of removing these columns yet still binding to that dataset?
1
by: pyssarma | last post by:
hi, I am new to mysql (4.0) php combination. Trying to display mysql table data using php. I have tested connection successfully but could not display table data using php. What could be the...
1
kaleeswaran
by: kaleeswaran | last post by:
HI! i am working in banking domain.. now i struggled with that displaying more number of rows in data..i have a screen like passing type like if the manager wants to passing the loan sanction...
2
by: JanDoggen | last post by:
function vldLicense($lic) { echo "called with lic: ". $lic . "<br>"; echo preg_match('', $lic) . "<br>"; if (preg_match('{4}-{4}-{4}-{4}', $lic) == 0) return false; return true; } gives me:
4
imarkdesigns
by: imarkdesigns | last post by:
Good day to all masters here.. good to be back here again and nice site! ok, i have a problem and still confusing to accomplish using 2 values in preg match. here is my sample code... <?php ...
4
by: hotmodi | last post by:
Hi How do i get space inside my preg match function? if (!preg_match('/^+$/', $facebook))
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.