php-general Digest 10 Jun 2008 09:42:55 -0000 Issue 5506

Topics (messages 275163 through 275169):

Re: Retrive a ID or Class value from a form input field
        275163 by: Jim Lucas

Preg_Replace $pattern syntax error
        275164 by: Graham Anderson

Preg_Replace $pattern syntax error [solved]
        275165 by: Graham Anderson

Re: mssql extension
        275166 by: Shawn McKenzie

Re: Imagick installation issue
        275167 by: Chris

Class & Type Casting
        275168 by: Leurent Francois
        275169 by: Richard Heyes

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Joe Harman wrote:
I was just writing a form validation script... I know that there is
ton of them out there... and i know that there are some different
methods of doing it... but i want to assign class names to each field
like class="req:email"... not sure if that is the right way to do it,
but i thought it would make thing neat and tidy

Thanks for all your input
Joe

Problem with that is the ':' is not a valid char for a class name.

Reference is here:  read the second bullet point

http://www.w3.org/TR/CSS21/syndata.html#characters

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare


--- End Message ---
--- Begin Message ---
Hi

How can I convert the regular expression: <p\s+style="padding-left: \s+(\d+)px;">(.*?)</p>
into a pattern that PHP will accept?

I am getting the error:
Warning: preg_replace() [function.preg-replace]: Unknown modifier '(' in /Library/WebServer/Documents/tamagotchi/runtime/content/js/tiny_mce/ examples/tinymce_regex.php on line 24

I am very new to regular expressions and any help is appreciated. Something to do with escaping certain strings?
G


$html =<<<EOB
TinyMCE is a <span style="font-style: italic;">platform</span>
<p style="text-align: center;">We recommend <a href="http://www.getfirefox.com " target="_blank">Firefox</a> </p>
<p style="padding-left: 30px;">May the Regular Expression Find Me!</p>
EOB;

$pattern='<p\s+style="padding-left:\s+(\d+)px;">(.*?)</p>';
$replace= '<textformat indent=\\1>\\2</textformat>';
echo preg_replace($pattern,$replace, $html );



--- End Message ---
--- Begin Message ---
I needed to add the ~ character as a delimiter. So, the below now works
$pattern='~<p\s+style="padding-left:\s+(\d+)px;">(.*?)</p>~';

G

Hi

How can I convert the regular expression: <p\s+style="padding- left:\s+(\d+)px;">(.*?)</p>
into a pattern that PHP will accept?

I am getting the error:
Warning: preg_replace() [function.preg-replace]: Unknown modifier '(' in /Library/WebServer/Documents/tamagotchi/runtime/content/js/ tiny_mce/examples/tinymce_regex.php on line 24

I am very new to regular expressions and any help is appreciated. Something to do with escaping certain strings?
G


$html =<<<EOB
TinyMCE is a <span style="font-style: italic;">platform</span>
<p style="text-align: center;">We recommend <a href="http://www.getfirefox.com " target="_blank">Firefox</a> </p>
<p style="padding-left: 30px;">May the Regular Expression Find Me!</p>
EOB;

$pattern='<p\s+style="padding-left:\s+(\d+)px;">(.*?)</p>';
$replace= '<textformat indent=\\1>\\2</textformat>';
echo preg_replace($pattern,$replace, $html );



--- End Message ---
--- Begin Message ---
Mathieu Pelletier wrote:
Hello !
My Workstation/server:
Window XPApache 2.2.4 (win32) PHP/5.2.3SQl Server 2003
I have never been able to load mssql extension in my life...In my php .ini file, I removed the ; correctly : extension=php_mssql.dll Other extensions work fine, for example I use the PDF extension :
extension=libpdf_php.dll
When I call phpinfo(), I can see informations about PDF, but nothing about mssql.
I was wondering if I have the good version of the dll in my "ext" directory..Or 
is SQl server 2003 compatible with XP and the latest version of php?
By the way, SQLServer works fine on my computer.
Thank you very much Mathieu
_________________________________________________________________


You restarted apache after uncommenting the line?

-Shawn

--- End Message ---
--- Begin Message ---
> This is the output for ldd -r for imagick.so. There are a number of 
> dependencies that I don't recognize 
> and I think there may be other packages that need to be installed.
> 
> 
> 
> undefined symbol: zend_ce_iterator      
> (/usr/local/lib/php/extensions/no-debug-non-zts-20060613//imagick.so)
> 
> undefined symbol: core_globals  
> (/usr/local/lib/php/extensions/no-debug-non-zts-20060613//imagick.so)
> 
> undefined symbol: executor_globals      
> (/usr/local/lib/php/extensions/no-debug-non-zts-20060613//imagick.so)
> 
> undefined symbol: zval_add_ref  
> (/usr/local/lib/php/extensions/no-debug-non-zts-20060613//imagick.so)
> 
> undefined symbol: OnUpdateBool  
> (/usr/local/lib/php/extensions/no-debug-non-zts-20060613//imagick.so)

How did you create the imagick.so file? Did you reconfigure php? What
configure command (and arguments) did you use? Did you get any errors
when you ran configure or make?

Normally when you try to build a module like this you need the -dev or
-devel or -headers package (ie imagemagick-dev or -devel or -headers
depending on how they decided to name it). Do you have that installed?

-- 
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
I was asking myself if there was a good reason this syntax not to work

class string_extented{
function __construct($str){
$this->contents=$str;
}
function __toString(){
return $this->contents;
}

}

//that's working fine
$test= new string_extended("this is my anonymous string");
echo $test;


/that's not working, but should'nt it be the case ?
$test = (string_extended) "This is my anonymous string";
echo $test;

I'll find this very usefull :x, it's just a syntax ehancement nope ?




--- End Message ---
--- Begin Message ---
//that's working fine
$test= new string_extended("this is my anonymous string");
echo $test;


/that's not working, but should'nt it be the case ?
$test = (string_extended) "This is my anonymous string";
echo $test;

I'll find this very usefull :x, it's just a syntax ehancement nope ?

Can't give you a definite answer but presumably it's not calling the constructor when you type cast it. Add a line to your constructor that will show if this is the case. Eg:

function __construct($str){
    $this->contents=$str;
    echo "In string_extended constructor...<br />\n";
}
--
              Richard Heyes

       In Cambridge or near Liverpool
    Street station in London? Employ me

        http://www.phpguru.org/cv

+----------------------------------------+
| Access SSH with a Windows mapped drive |
|    http://www.phpguru.org/sftpdrive    |
+----------------------------------------+

--- End Message ---

Reply via email to