[PHP] regex problem
hi, suppose there's a string $string=I like my(hot) coffee with sugar and (milk)(PHP); I would like to get an output of all possible combinations of the sentence with the words between brackets: eg. I like my hot coffee with sugar and I like my hot coffee with sugar and milk I like my hot coffee with sugar and milk php I like my coffee with sugar and I like my coffee with sugar and milk php etc.etc. The number of the words between brackets can differ and they can occur everywhere. The most important is that all combinations are returned but the sentence (not between brackets) should be there. I got something like: preg_match(/\((.*?)\)(.*)\((.*?)\)+/,$string,$regresult); but the \((.*?)\) part that matches the things between brackets is fixed. There can be a variable number of these words between brackets. How do i do this? And how could i easily get the combinations? Can i do it all just with preg_match or should i construct the combinations with some additional code? thanks; Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] function to update mysql tables?
Hi, I'm not sure if this is entirely php related, but I was wondering if there is a PHP function or a way to automatically update one table with values from another more extended table (automatically checking the common columns) and inserting new rows if they don't exist in the first table. Furthermore, I'm having difficulty inserting rows in a static myisam table (because i'm a beginner i suppose). The system crashes when I try to do this. According to mysql documentation it's because i only use int column types. So: is there a way to insert rows in a default static table? cheers, Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] systematic glitch in pages due to cache?
hello everybody, I have a real problem, and a vague description to it (can you guess?: newbie). I've created a site which retrieves a word from a database and displays it. The user enters another word (a translation) which is checked against the solution and feedback is given. These words are passed around in sessionvariables. Systematically after a while, I get a very slow loading of the page (and therefor the word i got from the database). In the end, i get my data, but it's slow and always with the same interval. I have a feeling this might be related to some garbage retrieval, or cache problem with the browser, but I can't figure it out. Does anybody has some suggestions? I'd really appreciate it! cheers, Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] convert encoding from unicode to EUC-JP
Hi, is there a way (php function, class, or a stand alone program (non-php) to easily convert unicode text that represents Japanese words in romaji into EUC_JP or SHIFT_JIS? thanks, Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP for 3D scatterplots
is there any code for this available yet? I am looking for a way of plotting gif images of objects in a 3D space... thank you! Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to pass values to PHP by clicking on imagemap
does anybody has a good suggestion for doing this? I just would like to pass a number by clicking on an imagemap to a php script... Sorry for the novice-ity of this mail, have a nice day! simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] simple yet weird... help pls
Please take a look at the script below. If i want to show an image it doesnt work if it's under an if statement. Why in this case? ? $feedb=0; if($feedb==0){ echo img scr='somepic.jpg';} echo img src='somepic.jpg'; ? How can i solve this problem? thank you! Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to calculate frequency of words in array?
Does anybody has a clever way to summarize the number of different words (with multiple occurences) from an array into an array with all the different words and the times they occured? Thanks a lot! Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_query: how to uniquely identify the query???
Hi, I'm a bit a newbie at the mysql-php tandem, but I wanted to ask a pretty basic question Supose you do x=mysql_query(/somequery/) // fetch a row and then later you do y=mysql_query(/somequery/) If you want to fetch the following row for the query in x, you should probably make the distinction with the query in y, how do you do this? Can you give an example? How does this relate to resource link_identifier? Does it? sorry if this might be a bit trivial, but i'm a little stuck, Simon -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] doskey and Mysql with Win9x?
How come doskey doesnt seem to work under Mysql running in Win9x? Is there an alternative instead of endless repetitve typing and quickly disintegrating wrists? Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how can i pass a javascript variable into a PHP variable?
Hi, does anyone has an idea and example how to get the value of a js variable into a PHP variable, preferably working with sessionvariables or a hiddenform? thank you! Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to get js screenresolution passed to a sessionvariable?
hi, I am trying to get the screenresolution passed from a javascript variable to a PHP variable using sessionvariables, but I can't get it to work, can you help me out to get some code working? I was thinking of something like this, but I'm pretty much a newbie at lots of things, so I'm sure this can be a piece'a cake. Thanks. Simon //put the form value in a sessionvariable session_register('Resolutionx'); //use a hiddenvalue in which js writes the x-resolution form name=anotherName input type=hidden name=Resolutionx value=0 //get the resolution script language=JavaScript!-- x=screen.width; document.anotherName.Resolutionx.value = x; //--/script -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php