Skip to content

Tag: php

Laravel use same form for create and edit

Am quite new to Laravel and I have to create a form for create and a form for edit. In my form I have quite some jquery ajax posts. Am wondering whether Laravel does provide for an easy way for me to use the same form for my edit and create without having to add tons of logic in my

Why php tag is not working in html file?

I have a register.php file and I have defined $name=”” inside that file and now in the html form I have: But the output is <?php echo $name; ?> instead of empty! Any idea of how I can fix this? Answer Your web server will server the HTML page as is. It will only parse the HTML as best as

How to determine if PHP OPcache is enabled or not?

I am trying to enable opCache on my server (ubuntu 12.04 LTS, running apache 2.4.7 with PHP Version 5.5.10-1+deb.sury.org~precise+1). Before starting to do anything, I read this highly relevant post which told me that opCache is disabled by default and I have to manually enable it. I went into php.ini and fou…

Explode a string to array with key => value

I have string is: How Can I convert from $string to an array with key => value. Updated: @Mark Baker my php version is 5.4 so I cannot test your code, thanks @Aleatoric I’m use this code, but the array return some space character on key and value: I have use trim() to strips all space, but can you te…